| 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 | 297 |
| 298 browser::ShowExtensionInstalledBubble(extension, browser, icon_, profile); | 298 browser::ShowExtensionInstalledBubble(extension, browser, icon_, profile); |
| 299 } | 299 } |
| 300 | 300 |
| 301 namespace { | 301 namespace { |
| 302 | 302 |
| 303 bool disable_failure_ui_for_tests = false; | 303 bool disable_failure_ui_for_tests = false; |
| 304 | 304 |
| 305 } // namespace | 305 } // namespace |
| 306 | 306 |
| 307 void ExtensionInstallUI::OnInstallFailure(const std::string& error) { | 307 void ExtensionInstallUI::OnInstallFailure(const string16& error) { |
| 308 DCHECK(ui_loop_ == MessageLoop::current()); | 308 DCHECK(ui_loop_ == MessageLoop::current()); |
| 309 | 309 |
| 310 Browser* browser = BrowserList::GetLastActiveWithProfile(profile_); | 310 Browser* browser = BrowserList::GetLastActiveWithProfile(profile_); |
| 311 if (disable_failure_ui_for_tests) | 311 if (disable_failure_ui_for_tests) |
| 312 return; | 312 return; |
| 313 browser::ShowErrorBox( | 313 browser::ShowErrorBox( |
| 314 browser ? browser->window()->GetNativeHandle() : NULL, | 314 browser ? browser->window()->GetNativeHandle() : NULL, |
| 315 l10n_util::GetStringUTF16(IDS_EXTENSION_INSTALL_FAILURE_TITLE), | 315 l10n_util::GetStringUTF16(IDS_EXTENSION_INSTALL_FAILURE_TITLE), |
| 316 UTF8ToUTF16(error)); | 316 error); |
| 317 } | 317 } |
| 318 | 318 |
| 319 void ExtensionInstallUI::SetIcon(SkBitmap* image) { | 319 void ExtensionInstallUI::SetIcon(SkBitmap* image) { |
| 320 if (image) | 320 if (image) |
| 321 icon_ = *image; | 321 icon_ = *image; |
| 322 else | 322 else |
| 323 icon_ = SkBitmap(); | 323 icon_ = SkBitmap(); |
| 324 if (icon_.empty()) | 324 if (icon_.empty()) |
| 325 icon_ = Extension::GetDefaultIcon(extension_->is_app()); | 325 icon_ = Extension::GetDefaultIcon(extension_->is_app()); |
| 326 } | 326 } |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 bool previous_using_native_theme) { | 431 bool previous_using_native_theme) { |
| 432 Profile* profile = tab_contents->profile(); | 432 Profile* profile = tab_contents->profile(); |
| 433 return new ThemeInstalledInfoBarDelegate( | 433 return new ThemeInstalledInfoBarDelegate( |
| 434 tab_contents->infobar_tab_helper(), | 434 tab_contents->infobar_tab_helper(), |
| 435 profile->GetExtensionService(), | 435 profile->GetExtensionService(), |
| 436 ThemeServiceFactory::GetForProfile(profile), | 436 ThemeServiceFactory::GetForProfile(profile), |
| 437 new_theme, | 437 new_theme, |
| 438 previous_theme_id, | 438 previous_theme_id, |
| 439 previous_using_native_theme); | 439 previous_using_native_theme); |
| 440 } | 440 } |
| OLD | NEW |