| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/string_split.h" | 7 #include "base/string_split.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/themes/browser_theme_pack.h" | 12 #include "chrome/browser/themes/browser_theme_pack.h" |
| 13 #include "chrome/common/chrome_constants.h" | 13 #include "chrome/common/chrome_constants.h" |
| 14 #include "chrome/common/chrome_notification_types.h" | 14 #include "chrome/common/chrome_notification_types.h" |
| 15 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
| 16 #include "content/browser/user_metrics.h" | 16 #include "content/browser/user_metrics.h" |
| 17 #include "content/common/notification_service.h" | 17 #include "content/common/notification_service.h" |
| 18 #include "grit/theme_resources.h" | 18 #include "grit/theme_resources.h" |
| 19 #include "grit/theme_resources_standard.h" | 19 #include "grit/theme_resources_standard.h" |
| 20 #include "grit/ui_resources.h" | 20 #include "grit/ui_resources.h" |
| 21 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
| 22 | 22 |
| 23 #if defined(OS_WIN) | 23 #if defined(OS_WIN) && !defined(USE_AURA) |
| 24 #include "views/widget/native_widget_win.h" | 24 #include "views/widget/native_widget_win.h" |
| 25 #endif | 25 #endif |
| 26 | 26 |
| 27 // Strings used in alignment properties. | 27 // Strings used in alignment properties. |
| 28 const char* ThemeService::kAlignmentTop = "top"; | 28 const char* ThemeService::kAlignmentTop = "top"; |
| 29 const char* ThemeService::kAlignmentBottom = "bottom"; | 29 const char* ThemeService::kAlignmentBottom = "bottom"; |
| 30 const char* ThemeService::kAlignmentLeft = "left"; | 30 const char* ThemeService::kAlignmentLeft = "left"; |
| 31 const char* ThemeService::kAlignmentRight = "right"; | 31 const char* ThemeService::kAlignmentRight = "right"; |
| 32 | 32 |
| 33 // Strings used in background tiling repetition properties. | 33 // Strings used in background tiling repetition properties. |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 bool ThemeService::GetDisplayProperty(int id, int* result) const { | 263 bool ThemeService::GetDisplayProperty(int id, int* result) const { |
| 264 if (theme_pack_.get()) | 264 if (theme_pack_.get()) |
| 265 return theme_pack_->GetDisplayProperty(id, result); | 265 return theme_pack_->GetDisplayProperty(id, result); |
| 266 | 266 |
| 267 return GetDefaultDisplayProperty(id, result); | 267 return GetDefaultDisplayProperty(id, result); |
| 268 } | 268 } |
| 269 | 269 |
| 270 bool ThemeService::ShouldUseNativeFrame() const { | 270 bool ThemeService::ShouldUseNativeFrame() const { |
| 271 if (HasCustomImage(IDR_THEME_FRAME)) | 271 if (HasCustomImage(IDR_THEME_FRAME)) |
| 272 return false; | 272 return false; |
| 273 #if defined(OS_WIN) | 273 #if defined(OS_WIN) && !defined(USE_AURA) |
| 274 return views::NativeWidgetWin::IsAeroGlassEnabled(); | 274 return views::NativeWidgetWin::IsAeroGlassEnabled(); |
| 275 #else | 275 #else |
| 276 return false; | 276 return false; |
| 277 #endif | 277 #endif |
| 278 } | 278 } |
| 279 | 279 |
| 280 bool ThemeService::HasCustomImage(int id) const { | 280 bool ThemeService::HasCustomImage(int id) const { |
| 281 if (!HasThemeableImage(id)) | 281 if (!HasThemeableImage(id)) |
| 282 return false; | 282 return false; |
| 283 | 283 |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 void ThemeService::OnInfobarDisplayed() { | 658 void ThemeService::OnInfobarDisplayed() { |
| 659 number_of_infobars_++; | 659 number_of_infobars_++; |
| 660 } | 660 } |
| 661 | 661 |
| 662 void ThemeService::OnInfobarDestroyed() { | 662 void ThemeService::OnInfobarDestroyed() { |
| 663 number_of_infobars_--; | 663 number_of_infobars_--; |
| 664 | 664 |
| 665 if (number_of_infobars_ == 0) | 665 if (number_of_infobars_ == 0) |
| 666 RemoveUnusedThemes(); | 666 RemoveUnusedThemes(); |
| 667 } | 667 } |
| OLD | NEW |