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/extensions/theme_installed_infobar_delegate.h" | 5 #include "chrome/browser/extensions/theme_installed_infobar_delegate.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
11 #include "chrome/browser/extensions/extension_service.h" | 11 #include "chrome/browser/extensions/extension_service.h" |
12 #include "chrome/browser/infobars/infobar_service.h" | 12 #include "chrome/browser/infobars/infobar_service.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/themes/theme_service.h" | 14 #include "chrome/browser/themes/theme_service.h" |
15 #include "chrome/browser/themes/theme_service_factory.h" | 15 #include "chrome/browser/themes/theme_service_factory.h" |
16 #include "chrome/browser/ui/browser_finder.h" | 16 #include "chrome/browser/ui/browser_finder.h" |
17 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 17 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 18 #include "chrome/grit/generated_resources.h" |
18 #include "components/infobars/core/infobar.h" | 19 #include "components/infobars/core/infobar.h" |
19 #include "content/public/browser/notification_source.h" | 20 #include "content/public/browser/notification_source.h" |
20 #include "extensions/browser/extension_system.h" | 21 #include "extensions/browser/extension_system.h" |
21 #include "extensions/common/extension.h" | 22 #include "extensions/common/extension.h" |
22 #include "grit/generated_resources.h" | |
23 #include "grit/theme_resources.h" | 23 #include "grit/theme_resources.h" |
24 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
25 | 25 |
26 | 26 |
27 // static | 27 // static |
28 void ThemeInstalledInfoBarDelegate::Create( | 28 void ThemeInstalledInfoBarDelegate::Create( |
29 const extensions::Extension* new_theme, | 29 const extensions::Extension* new_theme, |
30 Profile* profile, | 30 Profile* profile, |
31 const std::string& previous_theme_id, | 31 const std::string& previous_theme_id, |
32 bool previous_using_system_theme) { | 32 bool previous_using_system_theme) { |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 void ThemeInstalledInfoBarDelegate::Observe( | 154 void ThemeInstalledInfoBarDelegate::Observe( |
155 int type, | 155 int type, |
156 const content::NotificationSource& source, | 156 const content::NotificationSource& source, |
157 const content::NotificationDetails& details) { | 157 const content::NotificationDetails& details) { |
158 DCHECK_EQ(chrome::NOTIFICATION_BROWSER_THEME_CHANGED, type); | 158 DCHECK_EQ(chrome::NOTIFICATION_BROWSER_THEME_CHANGED, type); |
159 // If the new theme is different from what this info bar is associated with, | 159 // If the new theme is different from what this info bar is associated with, |
160 // close this info bar since it is no longer relevant. | 160 // close this info bar since it is no longer relevant. |
161 if (theme_id_ != theme_service_->GetThemeID()) | 161 if (theme_id_ != theme_service_->GetThemeID()) |
162 infobar()->RemoveSelf(); | 162 infobar()->RemoveSelf(); |
163 } | 163 } |
OLD | NEW |