Bug 1016184 - Part 3a: Fix typos and minor style changes. r=ehsan
authorTing-Yu Lin <tlin@mozilla.com>
Sun, 27 Jul 2014 00:13:00 +0200
changeset 198006 0a317ec96651b5a1a11c6907fbf1e42531f54fa7
parent 198005 392cc38c7981f6b1fd553e308bf33e17ed9e87e5
child 198007 fc35a676a4e6ebaf86ed3f9ed984e9af965e372d
push id1036
push userrnewman@mozilla.com
push dateWed, 06 Aug 2014 02:14:58 +0000
treeherderservices-central@3fd543e150c8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1016184
milestone34.0a1
Bug 1016184 - Part 3a: Fix typos and minor style changes. r=ehsan Also group the private section together, and remove the protect section since TouchCaret is a MOZ_FINAL class.
layout/base/TouchCaret.cpp
layout/base/TouchCaret.h
--- a/layout/base/TouchCaret.cpp
+++ b/layout/base/TouchCaret.cpp
@@ -120,17 +120,17 @@ TouchCaret::SetVisibility(bool aVisible)
   touchCaretElement->ClassList()->Toggle(NS_LITERAL_STRING("hidden"),
                                          dom::Optional<bool>(!mVisible),
                                          err);
   TOUCHCARET_LOG("Visibility %s", (mVisible ? "shown" : "hidden"));
 
   // Set touch caret expiration time.
   mVisible ? LaunchExpirationTimer() : CancelExpirationTimer();
 
-  // We must call SetHasTouchCaret() in order to get APZC to wait until the
+  // We must call SetMayHaveTouchCaret() in order to get APZC to wait until the
   // event has been round-tripped and check whether it has been handled,
   // otherwise B2G will end up panning the document when the user tries to drag
   // touch caret.
   presShell->SetMayHaveTouchCaret(mVisible);
 }
 
 nsRect
 TouchCaret::GetTouchFrameRect()
@@ -324,17 +324,17 @@ TouchCaret::IsOnTouchCaret(const nsPoint
     int32_t dy = Abs(aPoint.y - posY);
     distance = dx + dy;
   }
   return (distance <= TouchCaretMaxDistance());
 }
 
 nsresult
 TouchCaret::NotifySelectionChanged(nsIDOMDocument* aDoc, nsISelection* aSel,
-                                     int16_t aReason)
+                                   int16_t aReason)
 {
   // Hide touch caret while no caret exists.
   nsCOMPtr<nsIPresShell> presShell = do_QueryReferent(mPresShell);
   if (!presShell) {
     return NS_OK;
   }
 
   nsRefPtr<nsCaret> caret = presShell->GetCaret();
--- a/layout/base/TouchCaret.h
+++ b/layout/base/TouchCaret.h
@@ -14,26 +14,23 @@
 #include "nsITimer.h"
 #include "mozilla/EventForwards.h"
 #include "mozilla/TouchEvents.h"
 #include "Units.h"
 
 namespace mozilla {
 
 /**
- * The TouchCaret places a touch caret according to caret postion when the
+ * The TouchCaret places a touch caret according to caret position when the
  * caret is shown.
  * TouchCaret is also responsible for touch caret visibility. Touch caret
  * won't be shown when timer expires or while key event causes selection change.
  */
 class TouchCaret MOZ_FINAL : public nsISelectionListener
 {
-private:
-  ~TouchCaret();
-
 public:
   explicit TouchCaret(nsIPresShell* aPresShell);
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSISELECTIONLISTENER
 
   void Terminate()
   {
@@ -68,16 +65,18 @@ public:
   {
     return mVisible;
   }
 
 private:
   // Hide default constructor.
   TouchCaret() MOZ_DELETE;
 
+  ~TouchCaret();
+
   /**
    * Find the nsCanvasFrame which holds the touch caret.
    */
   nsIFrame* GetCanvasFrame();
 
   /**
    * Retrieve the bounding rectangle of the touch caret.
    *
@@ -230,17 +229,16 @@ private:
     return sTouchCaretMaxDistance;
   }
 
   static int32_t TouchCaretExpirationTime()
   {
     return sTouchCaretExpirationTime;
   }
 
-protected:
   nsWeakPtr mPresShell;
 
   // Touch caret visibility
   bool mVisible;
   // Touch caret timer
   nsCOMPtr<nsITimer> mTouchCaretExpirationTimer;
 
   // Preference