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/extensions/extension_install_ui.h" | 5 #include "chrome/browser/extensions/extension_install_ui.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 } | 191 } |
192 | 192 |
193 ExtensionInstallUI::ExtensionInstallUI(Profile* profile) | 193 ExtensionInstallUI::ExtensionInstallUI(Profile* profile) |
194 : profile_(profile), | 194 : profile_(profile), |
195 ui_loop_(MessageLoop::current()), | 195 ui_loop_(MessageLoop::current()), |
196 previous_using_native_theme_(false), | 196 previous_using_native_theme_(false), |
197 extension_(NULL), | 197 extension_(NULL), |
198 delegate_(NULL), | 198 delegate_(NULL), |
199 prompt_type_(NUM_PROMPT_TYPES), | 199 prompt_type_(NUM_PROMPT_TYPES), |
200 ALLOW_THIS_IN_INITIALIZER_LIST(tracker_(this)), | 200 ALLOW_THIS_IN_INITIALIZER_LIST(tracker_(this)), |
201 use_app_installed_bubble_(false) { | 201 use_app_installed_bubble_(false), |
| 202 skip_post_install_ui_(false) { |
202 // Remember the current theme in case the user presses undo. | 203 // Remember the current theme in case the user presses undo. |
203 if (profile_) { | 204 if (profile_) { |
204 const Extension* previous_theme = | 205 const Extension* previous_theme = |
205 ThemeServiceFactory::GetThemeForProfile(profile_); | 206 ThemeServiceFactory::GetThemeForProfile(profile_); |
206 if (previous_theme) | 207 if (previous_theme) |
207 previous_theme_id_ = previous_theme->id(); | 208 previous_theme_id_ = previous_theme->id(); |
208 previous_using_native_theme_ = | 209 previous_using_native_theme_ = |
209 ThemeServiceFactory::GetForProfile(profile_)->UsingNativeTheme(); | 210 ThemeServiceFactory::GetForProfile(profile_)->UsingNativeTheme(); |
210 } | 211 } |
211 } | 212 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 DCHECK(ui_loop_ == MessageLoop::current()); | 249 DCHECK(ui_loop_ == MessageLoop::current()); |
249 extension_ = extension; | 250 extension_ = extension; |
250 permissions_ = permissions; | 251 permissions_ = permissions; |
251 delegate_ = delegate; | 252 delegate_ = delegate; |
252 | 253 |
253 ShowConfirmation(PERMISSIONS_PROMPT); | 254 ShowConfirmation(PERMISSIONS_PROMPT); |
254 } | 255 } |
255 | 256 |
256 void ExtensionInstallUI::OnInstallSuccess(const Extension* extension, | 257 void ExtensionInstallUI::OnInstallSuccess(const Extension* extension, |
257 SkBitmap* icon) { | 258 SkBitmap* icon) { |
| 259 if (skip_post_install_ui_) |
| 260 return; |
| 261 |
258 extension_ = extension; | 262 extension_ = extension; |
259 SetIcon(icon); | 263 SetIcon(icon); |
260 | 264 |
261 if (extension->is_theme()) { | 265 if (extension->is_theme()) { |
262 ShowThemeInfoBar(previous_theme_id_, previous_using_native_theme_, | 266 ShowThemeInfoBar(previous_theme_id_, previous_using_native_theme_, |
263 extension, profile_); | 267 extension, profile_); |
264 return; | 268 return; |
265 } | 269 } |
266 | 270 |
267 // Extensions aren't enabled by default in incognito so we confirm | 271 // Extensions aren't enabled by default in incognito so we confirm |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 bool previous_using_native_theme) { | 425 bool previous_using_native_theme) { |
422 Profile* profile = tab_contents->profile(); | 426 Profile* profile = tab_contents->profile(); |
423 return new ThemeInstalledInfoBarDelegate( | 427 return new ThemeInstalledInfoBarDelegate( |
424 tab_contents->infobar_tab_helper(), | 428 tab_contents->infobar_tab_helper(), |
425 profile->GetExtensionService(), | 429 profile->GetExtensionService(), |
426 ThemeServiceFactory::GetForProfile(profile), | 430 ThemeServiceFactory::GetForProfile(profile), |
427 new_theme, | 431 new_theme, |
428 previous_theme_id, | 432 previous_theme_id, |
429 previous_using_native_theme); | 433 previous_using_native_theme); |
430 } | 434 } |
OLD | NEW |