OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_service.h" | 5 #include "chrome/browser/themes/theme_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/ref_counted_memory.h" | 8 #include "base/memory/ref_counted_memory.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 gfx::Image ThemeService::GetImageNamed(int id) const { | 108 gfx::Image ThemeService::GetImageNamed(int id) const { |
109 DCHECK(CalledOnValidThread()); | 109 DCHECK(CalledOnValidThread()); |
110 | 110 |
111 // For a managed user, use the special frame instead of the default one. | 111 // For a managed user, use the special frame instead of the default one. |
112 // TODO(akuegel): Remove this once we have the default managed user theme. | 112 // TODO(akuegel): Remove this once we have the default managed user theme. |
113 if (IsManagedUser()) { | 113 if (IsManagedUser()) { |
114 if (id == IDR_THEME_FRAME) | 114 if (id == IDR_THEME_FRAME) |
115 id = IDR_MANAGED_USER_THEME_FRAME; | 115 id = IDR_MANAGED_USER_THEME_FRAME; |
116 else if (id == IDR_THEME_FRAME_INACTIVE) | 116 else if (id == IDR_THEME_FRAME_INACTIVE) |
117 id = IDR_MANAGED_USER_THEME_FRAME_INACTIVE; | 117 id = IDR_MANAGED_USER_THEME_FRAME_INACTIVE; |
| 118 else if (id == IDR_THEME_TAB_BACKGROUND || id == IDR_THEME_TAB_BACKGROUND_V) |
| 119 id = IDR_MANAGED_USER_THEME_TAB_BACKGROUND; |
118 } | 120 } |
119 | 121 |
120 gfx::Image image; | 122 gfx::Image image; |
121 if (theme_pack_.get()) | 123 if (theme_pack_.get()) |
122 image = theme_pack_->GetImageNamed(id); | 124 image = theme_pack_->GetImageNamed(id); |
123 | 125 |
124 #if defined(USE_AURA) && !defined(USE_ASH) && defined(OS_LINUX) | 126 #if defined(USE_AURA) && !defined(USE_ASH) && defined(OS_LINUX) |
125 const ui::LinuxUI* linux_ui = ui::LinuxUI::instance(); | 127 const ui::LinuxUI* linux_ui = ui::LinuxUI::instance(); |
126 if (image.IsEmpty() && linux_ui) | 128 if (image.IsEmpty() && linux_ui) |
127 image = linux_ui->GetThemeImageNamed(id); | 129 image = linux_ui->GetThemeImageNamed(id); |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 void ThemeService::OnInfobarDestroyed() { | 458 void ThemeService::OnInfobarDestroyed() { |
457 number_of_infobars_--; | 459 number_of_infobars_--; |
458 | 460 |
459 if (number_of_infobars_ == 0) | 461 if (number_of_infobars_ == 0) |
460 RemoveUnusedThemes(); | 462 RemoveUnusedThemes(); |
461 } | 463 } |
462 | 464 |
463 ThemeSyncableService* ThemeService::GetThemeSyncableService() const { | 465 ThemeSyncableService* ThemeService::GetThemeSyncableService() const { |
464 return theme_syncable_service_.get(); | 466 return theme_syncable_service_.get(); |
465 } | 467 } |
OLD | NEW |