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/ui/extensions/extension_install_ui_default.h" | 5 #include "chrome/browser/ui/extensions/extension_install_ui_default.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/extensions/extension_install_prompt.h" | 10 #include "chrome/browser/extensions/extension_install_prompt.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 182 |
183 // static | 183 // static |
184 ExtensionInstallPrompt* ExtensionInstallUI::CreateInstallPromptWithProfile( | 184 ExtensionInstallPrompt* ExtensionInstallUI::CreateInstallPromptWithProfile( |
185 Profile* profile) { | 185 Profile* profile) { |
186 Browser* browser = chrome::FindLastActiveWithProfile(profile, | 186 Browser* browser = chrome::FindLastActiveWithProfile(profile, |
187 chrome::GetActiveDesktop()); | 187 chrome::GetActiveDesktop()); |
188 if (browser) | 188 if (browser) |
189 return CreateInstallPromptWithBrowser(browser); | 189 return CreateInstallPromptWithBrowser(browser); |
190 // No browser window is open yet. Create a free-standing dialog associated | 190 // No browser window is open yet. Create a free-standing dialog associated |
191 // with |profile|. | 191 // with |profile|. |
192 return new ExtensionInstallPrompt(profile, NULL, NULL); | 192 return new ExtensionInstallPrompt(profile, NULL); |
193 } | 193 } |
194 | 194 |
195 | |
196 // ExtensionInstallUIDefault -------------------------------------------------- | 195 // ExtensionInstallUIDefault -------------------------------------------------- |
197 | 196 |
198 ExtensionInstallUIDefault::ExtensionInstallUIDefault(Profile* profile) | 197 ExtensionInstallUIDefault::ExtensionInstallUIDefault(Profile* profile) |
199 : ExtensionInstallUI(profile), | 198 : ExtensionInstallUI(profile), |
200 previous_using_system_theme_(false), | 199 previous_using_system_theme_(false), |
201 use_app_installed_bubble_(false) { | 200 use_app_installed_bubble_(false) { |
202 // |profile| can be NULL during tests. | 201 // |profile| can be NULL during tests. |
203 if (profile) { | 202 if (profile) { |
204 // Remember the current theme in case the user presses undo. | 203 // Remember the current theme in case the user presses undo. |
205 const Extension* previous_theme = | 204 const Extension* previous_theme = |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 browser->tab_strip_model()->GetActiveWebContents(); | 274 browser->tab_strip_model()->GetActiveWebContents(); |
276 if (!web_contents) | 275 if (!web_contents) |
277 return; | 276 return; |
278 ErrorInfoBarDelegate::Create(InfoBarService::FromWebContents(web_contents), | 277 ErrorInfoBarDelegate::Create(InfoBarService::FromWebContents(web_contents), |
279 error); | 278 error); |
280 } | 279 } |
281 | 280 |
282 void ExtensionInstallUIDefault::SetUseAppInstalledBubble(bool use_bubble) { | 281 void ExtensionInstallUIDefault::SetUseAppInstalledBubble(bool use_bubble) { |
283 use_app_installed_bubble_ = use_bubble; | 282 use_app_installed_bubble_ = use_bubble; |
284 } | 283 } |
OLD | NEW |