Bug 864958 - Set url bar shadow color in private browsing mode. r=mhaigh
authorMichael Comella <michael.l.comella@gmail.com>
Thu, 25 Jun 2015 13:39:43 -0700
changeset 268452 d11dd076d026b89ec71fc576e3e490960d01fb22
parent 268451 f8d90a2adc9d72d055aabe09cf5fc5b607541d0a
child 268453 7ca978706f30f459f9df8724b670f9ff18d3a15a
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-esr52@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhaigh
bugs864958
milestone41.0a1
Bug 864958 - Set url bar shadow color in private browsing mode. r=mhaigh
mobile/android/base/resources/values/colors.xml
mobile/android/base/toolbar/BrowserToolbar.java
--- a/mobile/android/base/resources/values/colors.xml
+++ b/mobile/android/base/resources/values/colors.xml
@@ -22,16 +22,18 @@
 
   <color name="tabs_tray_icon_grey">#AFB1B3</color>
   <color name="disabled_grey">#BFBFBF</color>
   <color name="toolbar_grey_pressed">#D7D7DC</color>
   <color name="toolbar_menu_dark_grey">#E1E1E6</color>
   <color name="toolbar_grey">#EBEBF0</color>
   <color name="about_page_header_grey">#F5F5F5</color>
 
+  <color name="url_bar_shadow_private">#7878A5</color>
+
   <!-- Non-palette colors -->
 
   <!-- Synced w/ toolbar_grey -->
   <color name="background_normal_lwt">#DDEBEBF0</color>
 
   <color name="background_tabs">#FF363B40</color>
   <color name="highlight">#33000000</color>
   <color name="highlight_focused">#1A000000</color>
--- a/mobile/android/base/toolbar/BrowserToolbar.java
+++ b/mobile/android/base/toolbar/BrowserToolbar.java
@@ -128,16 +128,18 @@ public abstract class BrowserToolbar ext
 
     protected final BrowserApp activity;
     protected boolean hasSoftMenuButton;
 
     protected UIMode uiMode;
     protected TabHistoryController tabHistoryController;
 
     private final Paint shadowPaint;
+    private final int shadowColor;
+    private final int shadowPrivateColor;
     private final int shadowSize;
 
     private final ToolbarPrefs prefs;
     private boolean contextMenuEnabled = true;
 
     public abstract boolean isAnimating();
 
     protected abstract boolean isTabsButtonOffscreen();
@@ -195,17 +197,19 @@ public abstract class BrowserToolbar ext
 
         // The focusOrder List should be filled by sub-classes.
         focusOrder = new ArrayList<View>();
 
         final Resources res = getResources();
         shadowSize = res.getDimensionPixelSize(R.dimen.browser_toolbar_shadow_size);
 
         shadowPaint = new Paint();
-        shadowPaint.setColor(res.getColor(R.color.url_bar_shadow));
+        shadowColor = res.getColor(R.color.url_bar_shadow);
+        shadowPrivateColor = res.getColor(R.color.url_bar_shadow_private);
+        shadowPaint.setColor(shadowColor);
         shadowPaint.setStrokeWidth(0.0f);
 
         setUIMode(UIMode.DISPLAY);
 
         prefs = new ToolbarPrefs();
         urlDisplayLayout.setToolbarPrefs(prefs);
         urlEditLayout.setToolbarPrefs(prefs);
     }
@@ -832,16 +836,18 @@ public abstract class BrowserToolbar ext
 
     @Override
     public void setPrivateMode(boolean isPrivate) {
         super.setPrivateMode(isPrivate);
 
         tabsButton.setPrivateMode(isPrivate);
         menuButton.setPrivateMode(isPrivate);
         urlEditLayout.setPrivateMode(isPrivate);
+
+        shadowPaint.setColor(isPrivate ? shadowPrivateColor : shadowColor);
     }
 
     public void show() {
         setVisibility(View.VISIBLE);
     }
 
     public void hide() {
         setVisibility(View.GONE);