| 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/extension_install_ui_default.h" | 5 #include "chrome/browser/extensions/extension_install_ui_default.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" | 9 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" |
| 10 #include "chrome/browser/extensions/extension_install_prompt.h" | 10 #include "chrome/browser/extensions/extension_install_prompt.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 ExtensionInstallUIDefault::ExtensionInstallUIDefault(Profile* profile) | 94 ExtensionInstallUIDefault::ExtensionInstallUIDefault(Profile* profile) |
| 95 : skip_post_install_ui_(false), | 95 : skip_post_install_ui_(false), |
| 96 previous_using_native_theme_(false), | 96 previous_using_native_theme_(false), |
| 97 use_app_installed_bubble_(false) { | 97 use_app_installed_bubble_(false) { |
| 98 profile_ = profile; | 98 profile_ = profile; |
| 99 | 99 |
| 100 // |profile_| can be NULL during tests. | 100 // |profile_| can be NULL during tests. |
| 101 if (profile_) { | 101 if (profile_) { |
| 102 // Remember the current theme in case the user presses undo. | 102 // Remember the current theme in case the user presses undo. |
| 103 previous_theme_id_ = ThemeService::GetThemeIDForProfile(profile); | 103 const Extension* previous_theme = |
| 104 ThemeServiceFactory::GetThemeForProfile(profile); |
| 105 if (previous_theme) |
| 106 previous_theme_id_ = previous_theme->id(); |
| 104 previous_using_native_theme_ = | 107 previous_using_native_theme_ = |
| 105 ThemeServiceFactory::GetForProfile(profile)->UsingNativeTheme(); | 108 ThemeServiceFactory::GetForProfile(profile)->UsingNativeTheme(); |
| 106 } | 109 } |
| 107 } | 110 } |
| 108 | 111 |
| 109 ExtensionInstallUIDefault::~ExtensionInstallUIDefault() { | 112 ExtensionInstallUIDefault::~ExtensionInstallUIDefault() { |
| 110 } | 113 } |
| 111 | 114 |
| 112 void ExtensionInstallUIDefault::OnInstallSuccess(const Extension* extension, | 115 void ExtensionInstallUIDefault::OnInstallSuccess(const Extension* extension, |
| 113 SkBitmap* icon) { | 116 SkBitmap* icon) { |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 return new ExtensionInstallPrompt(web_contents); | 285 return new ExtensionInstallPrompt(web_contents); |
| 283 } | 286 } |
| 284 | 287 |
| 285 // static | 288 // static |
| 286 ExtensionInstallPrompt* ExtensionInstallUI::CreateInstallPromptWithProfile( | 289 ExtensionInstallPrompt* ExtensionInstallUI::CreateInstallPromptWithProfile( |
| 287 Profile* profile) { | 290 Profile* profile) { |
| 288 Browser* browser = chrome::FindLastActiveWithProfile(profile, | 291 Browser* browser = chrome::FindLastActiveWithProfile(profile, |
| 289 chrome::GetActiveDesktop()); | 292 chrome::GetActiveDesktop()); |
| 290 return CreateInstallPromptWithBrowser(browser); | 293 return CreateInstallPromptWithBrowser(browser); |
| 291 } | 294 } |
| OLD | NEW |