Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: chrome/browser/themes/theme_properties.cc

Issue 1164333002: ToolbarView MaterialDesign in ThemeProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/themes/theme_properties.h" 5 #include "chrome/browser/themes/theme_properties.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/strings/string_split.h" 8 #include "base/strings/string_split.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "chrome/browser/themes/browser_theme_pack.h" 10 #include "chrome/browser/themes/browser_theme_pack.h"
11 #include "grit/theme_resources.h" 11 #include "grit/theme_resources.h"
12 #include "ui/base/resource/material_design/material_design_controller.h"
12 #include "ui/resources/grit/ui_resources.h" 13 #include "ui/resources/grit/ui_resources.h"
13 14
14 namespace { 15 namespace {
15 16
16 // ---------------------------------------------------------------------------- 17 // ----------------------------------------------------------------------------
17 // Defaults for properties which are stored in the browser theme pack. If you 18 // Defaults for properties which are stored in the browser theme pack. If you
18 // change these defaults, you must increment the version number in 19 // change these defaults, you must increment the version number in
19 // browser_theme_pack.h 20 // browser_theme_pack.h
20 21
21 // Default colors. 22 // Default colors.
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 #if defined(OS_MACOSX) 90 #if defined(OS_MACOSX)
90 const SkColor kDefaultColorToolbarButtonStroke = SkColorSetARGB(75, 81, 81, 81); 91 const SkColor kDefaultColorToolbarButtonStroke = SkColorSetARGB(75, 81, 81, 81);
91 const SkColor kDefaultColorToolbarButtonStrokeInactive = 92 const SkColor kDefaultColorToolbarButtonStrokeInactive =
92 SkColorSetARGB(75, 99, 99, 99); 93 SkColorSetARGB(75, 99, 99, 99);
93 const SkColor kDefaultColorToolbarBezel = SkColorSetRGB(204, 204, 204); 94 const SkColor kDefaultColorToolbarBezel = SkColorSetRGB(204, 204, 204);
94 const SkColor kDefaultColorToolbarStroke = SkColorSetRGB(103, 103, 103); 95 const SkColor kDefaultColorToolbarStroke = SkColorSetRGB(103, 103, 103);
95 const SkColor kDefaultColorToolbarStrokeInactive = SkColorSetRGB(163, 163, 163); 96 const SkColor kDefaultColorToolbarStrokeInactive = SkColorSetRGB(163, 163, 163);
96 #endif 97 #endif
97 98
98 // ---------------------------------------------------------------------------- 99 // ----------------------------------------------------------------------------
100 // Defaults for layout properties which are not stored in the browser theme
101 // pack. The array indices map to ui::MaterialDesignController::Mode.
pkotwicz 2015/07/07 14:30:27 Adding a comment with the mapping of the MaterialD
Peter Kasting 2015/07/07 19:01:16 OTOH if we do that we have copies of the same info
sadrul 2015/07/07 21:53:04 Maybe have COMPILE_ASSERT()s here to make sure if
jonross 2015/07/08 15:23:39 Updated the comments to point to the header. Added
jonross 2015/07/08 15:23:39 Done.
102
103 // The edge graphics have some built-in spacing/shadowing, so we have to adjust
104 // our spacing to make it match.
105 const int kToolbarViewLeftEdgeSpacing[] = {3, 4, 8};
106 const int kToolbarViewRightEdgeSpacing[] = {2, 4, 8};
107
108 // Ash doesn't use a rounded content area and its top edge has an extra shadow.
109 const int kToolbarViewContentShadowHeightAsh[] = {2, 0, 0};
110
111 // Non-ash uses a rounded content area with no shadow in the assets.
112 const int kToolbarViewContentShadowHeight[] = {0, 0, 0};
113
114 // ----------------------------------------------------------------------------
99 115
100 // Strings used in alignment properties. 116 // Strings used in alignment properties.
101 const char kAlignmentCenter[] = "center"; 117 const char kAlignmentCenter[] = "center";
102 const char kAlignmentTop[] = "top"; 118 const char kAlignmentTop[] = "top";
103 const char kAlignmentBottom[] = "bottom"; 119 const char kAlignmentBottom[] = "bottom";
104 const char kAlignmentLeft[] = "left"; 120 const char kAlignmentLeft[] = "left";
105 const char kAlignmentRight[] = "right"; 121 const char kAlignmentRight[] = "right";
106 122
107 // Strings used in background tiling repetition properties. 123 // Strings used in background tiling repetition properties.
108 const char kTilingNoRepeat[] = "no-repeat"; 124 const char kTilingNoRepeat[] = "no-repeat";
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 return kDefaultColorToolbarStrokeInactive; 308 return kDefaultColorToolbarStrokeInactive;
293 #endif 309 #endif
294 default: 310 default:
295 // Return a debugging red color. 311 // Return a debugging red color.
296 return SK_ColorRED; 312 return SK_ColorRED;
297 } 313 }
298 } 314 }
299 315
300 // static 316 // static
301 int ThemeProperties::GetDefaultDisplayProperty(int id) { 317 int ThemeProperties::GetDefaultDisplayProperty(int id) {
318 int mode = static_cast<int>(ui::MaterialDesignController::GetMode());
302 switch (id) { 319 switch (id) {
303 case NTP_BACKGROUND_ALIGNMENT: 320 case ThemeProperties::NTP_BACKGROUND_ALIGNMENT:
304 return kDefaultDisplayPropertyNTPAlignment; 321 return kDefaultDisplayPropertyNTPAlignment;
305 case NTP_BACKGROUND_TILING: 322 case ThemeProperties::NTP_BACKGROUND_TILING:
306 return kDefaultDisplayPropertyNTPTiling; 323 return kDefaultDisplayPropertyNTPTiling;
307 case NTP_LOGO_ALTERNATE: 324 case ThemeProperties::NTP_LOGO_ALTERNATE:
308 return kDefaultDisplayPropertyNTPAlternateLogo; 325 return kDefaultDisplayPropertyNTPAlternateLogo;
326 case ThemeProperties::PROPERTY_TOOLBAR_VIEW_LEFT_EDGE_SPACING:
327 return kToolbarViewLeftEdgeSpacing[mode];
328 case ThemeProperties::PROPERTY_TOOLBAR_VIEW_RIGHT_EDGE_SPACING:
329 return kToolbarViewRightEdgeSpacing[mode];
330 case ThemeProperties::PROPERTY_TOOLBAR_VIEW_CONTENT_SHADOW_HEIGHT_ASH:
331 return kToolbarViewContentShadowHeightAsh[mode];
332 case ThemeProperties::PROPERTY_TOOLBAR_VIEW_CONTENT_SHADOW_HEIGHT:
333 return kToolbarViewContentShadowHeight[mode];
334 default:
335 return -1;
309 } 336 }
310
311 return -1;
312 } 337 }
OLDNEW
« no previous file with comments | « chrome/browser/themes/theme_properties.h ('k') | chrome/browser/ui/views/toolbar/toolbar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698