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

Side by Side Diff: chrome/browser/managed_mode/managed_user_theme.cc

Issue 19471005: Add custom default theme support and create a managed user default theme. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 7 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/managed_mode/managed_user_theme.h"
6
7 #include "chrome/browser/themes/theme_properties.h"
8 #include "grit/theme_resources.h"
9 #include "ui/gfx/image/image.h"
10
11 namespace {
12 const SkColor kDefaultColorFrameManagedUser = SkColorSetRGB(165, 197, 225);
13 const SkColor kDefaultColorFrameManagedUserInactive =
14 SkColorSetRGB(180, 225, 247);
15 }
pkotwicz 2013/07/19 18:33:20 Nit: } // namespace
Adrian Kuegel 2013/07/22 12:58:08 Done.
16
17 ManagedUserTheme::ManagedUserTheme()
18 : CustomThemeSupplier(MANAGED_USER_THEME),
19 rb_(ResourceBundle::GetSharedInstance()) {}
20
21 ManagedUserTheme::~ManagedUserTheme() {}
22
23 bool ManagedUserTheme::GetColor(int id, SkColor* color) const {
24 if (id == ThemeProperties::COLOR_FRAME) {
25 *color = kDefaultColorFrameManagedUser;
26 return true;
27 }
28 if (id == ThemeProperties::COLOR_FRAME_INACTIVE) {
29 *color = kDefaultColorFrameManagedUserInactive;
30 return true;
31 }
32 if (id == ThemeProperties::COLOR_MANAGED_USER_LABEL) {
pkotwicz 2013/07/19 18:33:20 I would have expected for COLOR_MANAGED_USER_LABEL
Adrian Kuegel 2013/07/22 12:58:08 The reason I do it here and in the ThemeService is
33 *color = SK_ColorWHITE;
34 return true;
35 }
36 if (id == ThemeProperties::COLOR_MANAGED_USER_LABEL_BACKGROUND) {
37 *color = SkColorSetRGB(108, 167, 210);
38 return true;
39 }
40 return false;
41 }
42
43 gfx::Image ManagedUserTheme::GetImageNamed(int id) {
44 if (id == IDR_THEME_FRAME)
45 id = IDR_MANAGED_USER_THEME_FRAME;
46 else if (id == IDR_THEME_FRAME_INACTIVE)
47 id = IDR_MANAGED_USER_THEME_FRAME_INACTIVE;
48 else if (id == IDR_THEME_TAB_BACKGROUND || id == IDR_THEME_TAB_BACKGROUND_V)
49 id = IDR_MANAGED_USER_THEME_TAB_BACKGROUND;
50 return rb_.GetNativeImageNamed(id);
pkotwicz 2013/07/19 18:33:20 Return an empty gfx::Image if HasCustomImage() ==
Adrian Kuegel 2013/07/22 12:58:08 Done.
51 }
52
53 bool ManagedUserTheme::HasCustomImage(int id) const {
54 return (id == IDR_THEME_FRAME || id == IDR_THEME_FRAME_INACTIVE ||
55 id == IDR_THEME_TAB_BACKGROUND || id == IDR_THEME_TAB_BACKGROUND_V);
56 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698