Bug 959185 - Changed access modifiers of methods and variables unused outside toolbar package from 'public' to 'default' or 'private'. r=vp
authorAlex Deaconu <alexandru.deaconu@ebsromania.ro>
Sat, 19 Apr 2014 15:17:17 +0300
changeset 198190 0db08c20683df1ec90ca239587f78e5031ce80c6
parent 198189 582d63059339de3c2eb418f34998c88e63cb4c00
child 198191 ae3d07b6778c8a5ead0f75bebd9345fc3a50273c
push idunknown
push userunknown
push dateunknown
reviewersvp
bugs959185
milestone31.0a1
Bug 959185 - Changed access modifiers of methods and variables unused outside toolbar package from 'public' to 'default' or 'private'. r=vp
mobile/android/base/toolbar/BrowserToolbar.java
mobile/android/base/toolbar/CanvasDelegate.java
mobile/android/base/toolbar/PageActionLayout.java
mobile/android/base/toolbar/TabCounter.java
mobile/android/base/toolbar/ToolbarDisplayLayout.java
mobile/android/base/toolbar/ToolbarTitlePrefs.java
--- a/mobile/android/base/toolbar/BrowserToolbar.java
+++ b/mobile/android/base/toolbar/BrowserToolbar.java
@@ -141,17 +141,17 @@ public class BrowserToolbar extends Them
 
     private boolean shouldShrinkURLBar = false;
 
     private OnActivateListener activateListener;
     private OnFocusChangeListener focusChangeListener;
     private OnStartEditingListener startEditingListener;
     private OnStopEditingListener stopEditingListener;
 
-    final private BrowserApp activity;
+    private final BrowserApp activity;
     private boolean hasSoftMenuButton;
 
     private UIMode uiMode;
     private boolean isAnimatingEntry;
 
     private int urlBarViewOffset;
     private int defaultForwardMargin;
 
@@ -576,17 +576,17 @@ public class BrowserToolbar extends Them
         if (!isEditing() && selectedTab.getState() == Tab.STATE_LOADING) {
             progressBar.setProgress(progress);
             progressBar.setVisibility(View.VISIBLE);
         } else {
             progressBar.setVisibility(View.GONE);
         }
     }
 
-    public boolean isVisible() {
+    private boolean isVisible() {
         return ViewHelper.getTranslationY(this) == 0;
     }
 
     @Override
     public void setNextFocusDownId(int nextId) {
         super.setNextFocusDownId(nextId);
         tabsButton.setNextFocusDownId(nextId);
         backButton.setNextFocusDownId(nextId);
@@ -1195,17 +1195,17 @@ public class BrowserToolbar extends Them
                 updateTabCountAndAnimate(Tabs.getInstance().getDisplayCount());
             }
         });
 
         isAnimatingEntry = true;
         contentAnimator.start();
     }
 
-    public void setButtonEnabled(ImageButton button, boolean enabled) {
+    private void setButtonEnabled(ImageButton button, boolean enabled) {
         final Drawable drawable = button.getDrawable();
         if (drawable != null) {
             // This alpha value has to be in sync with the one used
             // in updateChildrenForEditing().
             drawable.setAlpha(enabled ? 255 : 61);
         }
 
         button.setEnabled(enabled);
--- a/mobile/android/base/toolbar/CanvasDelegate.java
+++ b/mobile/android/base/toolbar/CanvasDelegate.java
@@ -8,39 +8,39 @@ import android.graphics.Bitmap;
 import android.graphics.Canvas;
 import android.graphics.Paint;
 import android.graphics.Path;
 import android.graphics.PorterDuff.Mode;
 import android.graphics.PorterDuffXfermode;
 import android.graphics.Shader;
 import android.os.Build;
 
-public class CanvasDelegate {
+class CanvasDelegate {
     Paint mPaint;
     PorterDuffXfermode mMode;
     DrawManager mDrawManager;
 
     // DrawManager would do a default draw of the background.
-    public static interface DrawManager {
+    static interface DrawManager {
         public void defaultDraw(Canvas cavas);
     }
 
-    public CanvasDelegate(DrawManager drawManager, Mode mode) {
+    CanvasDelegate(DrawManager drawManager, Mode mode) {
         mDrawManager = drawManager;
 
         // DST_IN masks, DST_OUT clips.
         mMode = new PorterDuffXfermode(mode);
 
         mPaint = new Paint();
         mPaint.setAntiAlias(true);
         mPaint.setColor(0xFFFF0000);
         mPaint.setStrokeWidth(0.0f);
     }
 
-    public void draw(Canvas canvas, Path path, int width, int height) {
+    void draw(Canvas canvas, Path path, int width, int height) {
         // Save the canvas. All PorterDuff operations should be done in a offscreen bitmap.
         int count = canvas.saveLayer(0, 0, width, height, null,
                                      Canvas.MATRIX_SAVE_FLAG |
                                      Canvas.CLIP_SAVE_FLAG |
                                      Canvas.HAS_ALPHA_LAYER_SAVE_FLAG |
                                      Canvas.FULL_COLOR_LAYER_SAVE_FLAG |
                                      Canvas.CLIP_TO_LAYER_SAVE_FLAG);
 
@@ -65,12 +65,12 @@ public class CanvasDelegate {
                 mPaint.setXfermode(null);
             }
         }
 
         // Restore the canvas.
         canvas.restoreToCount(count);
     }
 
-    public void setShader(Shader shader) {
+    void setShader(Shader shader) {
         mPaint.setShader(shader);
     }
 }
--- a/mobile/android/base/toolbar/PageActionLayout.java
+++ b/mobile/android/base/toolbar/PageActionLayout.java
@@ -59,17 +59,17 @@ public class PageActionLayout extends Li
         mPageActionList = new ArrayList<PageAction>();
         setNumberShown(DEFAULT_PAGE_ACTIONS_SHOWN);
         refreshPageActionIcons();
 
         registerEventListener("PageActions:Add");
         registerEventListener("PageActions:Remove");
     }
 
-    public void setNumberShown(int count) {
+    private void setNumberShown(int count) {
         mMaxVisiblePageActions = count;
 
         for(int index = 0; index < count; index++) {
             if ((this.getChildCount() - 1) < index) {
                 mLayout.addView(createImageButton());
             }
         }
     }
@@ -113,17 +113,17 @@ public class PageActionLayout extends Li
 
                 removePageAction(id);
             }
         } catch(JSONException ex) {
             Log.e(LOGTAG, "Error deocding", ex);
         }
     }
 
-    public void addPageAction(final String id, final String title, final String imageData, final OnPageActionClickListeners mOnPageActionClickListeners, boolean mImportant) {
+    private void addPageAction(final String id, final String title, final String imageData, final OnPageActionClickListeners mOnPageActionClickListeners, boolean mImportant) {
         final PageAction pageAction = new PageAction(id, title, null, mOnPageActionClickListeners, mImportant);
 
         int insertAt = mPageActionList.size();
         while(insertAt > 0 && mPageActionList.get(insertAt-1).isImportant()) {
           insertAt--;
         }
         mPageActionList.add(insertAt, pageAction);
 
@@ -133,17 +133,17 @@ public class PageActionLayout extends Li
                 if (mPageActionList.contains(pageAction)) {
                     pageAction.setDrawable(d);
                     refreshPageActionIcons();
                 }
             }
         });
     }
 
-    public void removePageAction(String id) {
+    private void removePageAction(String id) {
         for(int i = 0; i < mPageActionList.size(); i++) {
             if (mPageActionList.get(i).getID().equals(id)) {
                 mPageActionList.remove(i);
                 refreshPageActionIcons();
                 return;
             }
         }
     }
@@ -286,17 +286,17 @@ public class PageActionLayout extends Li
                 PageAction pageAction = mPageActionList.get(i);
                 MenuItem item = menu.add(Menu.NONE, pageAction.key(), Menu.NONE, pageAction.getTitle());
                 item.setIcon(pageAction.getDrawable());
             }
         }
         mPageActionsMenu.show();
     }
 
-    public static interface OnPageActionClickListeners {
+    private static interface OnPageActionClickListeners {
         public void onClick(String id);
         public boolean onLongClick(String id);
     }
 
     private static class PageAction {
         private OnPageActionClickListeners mOnPageActionClickListeners;
         private Drawable mDrawable;
         private String mTitle;
--- a/mobile/android/base/toolbar/TabCounter.java
+++ b/mobile/android/base/toolbar/TabCounter.java
@@ -62,17 +62,17 @@ public class TabCounter extends ThemedTe
             setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
             setAccessibilityDelegate(new View.AccessibilityDelegate() {
                     @Override
                     public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {}
                 });
         }
     }
 
-    public void setCountWithAnimation(int count) {
+    void setCountWithAnimation(int count) {
         // Don't animate from initial state
         if (mCount == 0) {
             setCount(count);
             return;
         }
 
         if (mCount == count) {
             return;
@@ -92,17 +92,17 @@ public class TabCounter extends ThemedTe
 
         // Set In value, trigger animation to Out value
         setCurrentText(String.valueOf(mCount));
         setText(String.valueOf(count));
 
         mCount = count;
     }
 
-    public void setCount(int count) {
+    void setCount(int count) {
         setCurrentText(String.valueOf(count));
         mCount = count;
     }
 
     // Alpha animations in editing mode cause action bar corruption on the
     // Nexus 7 (bug 961749). As a workaround, skip these animations in editing
     // mode.
     void onEnterEditingMode() {
--- a/mobile/android/base/toolbar/ToolbarDisplayLayout.java
+++ b/mobile/android/base/toolbar/ToolbarDisplayLayout.java
@@ -90,17 +90,17 @@ public class ToolbarDisplayLayout extend
     interface OnStopListener {
         public Tab onStop();
     }
 
     interface OnTitleChangeListener {
         public void onTitleChange(CharSequence title);
     }
 
-    final private BrowserApp mActivity;
+    private final BrowserApp mActivity;
 
     private UIMode mUiMode;
 
     private ThemedTextView mTitle;
     private int mTitlePadding;
     private ToolbarTitlePrefs mTitlePrefs;
     private OnTitleChangeListener mTitleChangeListener;
 
--- a/mobile/android/base/toolbar/ToolbarTitlePrefs.java
+++ b/mobile/android/base/toolbar/ToolbarTitlePrefs.java
@@ -6,18 +6,18 @@
 package org.mozilla.gecko.toolbar;
 
 import org.mozilla.gecko.PrefsHelper;
 import org.mozilla.gecko.Tab;
 import org.mozilla.gecko.Tabs;
 import org.mozilla.gecko.util.ThreadUtils;
 
 class ToolbarTitlePrefs {
-    public static final String PREF_TITLEBAR_MODE = "browser.chrome.titlebarMode";
-    public static final String PREF_TRIM_URLS = "browser.urlbar.trimURLs";
+    static final String PREF_TITLEBAR_MODE = "browser.chrome.titlebarMode";
+    static final String PREF_TRIM_URLS = "browser.urlbar.trimURLs";
 
     interface OnChangeListener {
         public void onChange();
     }
 
     final String[] prefs = {
         PREF_TITLEBAR_MODE,
         PREF_TRIM_URLS