| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 void ExtensionInstallUI::OnInstallFailure(const std::string& error) { | 253 void ExtensionInstallUI::OnInstallFailure(const std::string& error) { |
| 254 DCHECK(ui_loop_ == MessageLoop::current()); | 254 DCHECK(ui_loop_ == MessageLoop::current()); |
| 255 | 255 |
| 256 Browser* browser = BrowserList::GetLastActiveWithProfile(profile_); | 256 Browser* browser = BrowserList::GetLastActiveWithProfile(profile_); |
| 257 platform_util::SimpleErrorBox( | 257 platform_util::SimpleErrorBox( |
| 258 browser ? browser->window()->GetNativeHandle() : NULL, | 258 browser ? browser->window()->GetNativeHandle() : NULL, |
| 259 l10n_util::GetStringUTF16(IDS_EXTENSION_INSTALL_FAILURE_TITLE), | 259 l10n_util::GetStringUTF16(IDS_EXTENSION_INSTALL_FAILURE_TITLE), |
| 260 UTF8ToUTF16(error)); | 260 UTF8ToUTF16(error)); |
| 261 } | 261 } |
| 262 | 262 |
| 263 void ExtensionInstallUI::OnOverinstallAttempted(Extension* extension) { | |
| 264 ShowThemeInfoBar(previous_theme_id_, previous_use_system_theme_, | |
| 265 extension, profile_); | |
| 266 } | |
| 267 | |
| 268 void ExtensionInstallUI::OnImageLoaded( | 263 void ExtensionInstallUI::OnImageLoaded( |
| 269 SkBitmap* image, ExtensionResource resource, int index) { | 264 SkBitmap* image, ExtensionResource resource, int index) { |
| 270 if (image) | 265 if (image) |
| 271 icon_ = *image; | 266 icon_ = *image; |
| 272 else | 267 else |
| 273 icon_ = SkBitmap(); | 268 icon_ = SkBitmap(); |
| 274 if (icon_.empty()) { | 269 if (icon_.empty()) { |
| 275 icon_ = *ResourceBundle::GetSharedInstance().GetBitmapNamed( | 270 icon_ = *ResourceBundle::GetSharedInstance().GetBitmapNamed( |
| 276 IDR_EXTENSION_DEFAULT_ICON); | 271 IDR_EXTENSION_DEFAULT_ICON); |
| 277 } | 272 } |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 TabContents* tab_contents, Extension* new_theme, | 382 TabContents* tab_contents, Extension* new_theme, |
| 388 const std::string& previous_theme_id, bool previous_use_system_theme) { | 383 const std::string& previous_theme_id, bool previous_use_system_theme) { |
| 389 #if defined(TOOLKIT_GTK) | 384 #if defined(TOOLKIT_GTK) |
| 390 return new GtkThemeInstalledInfoBarDelegate(tab_contents, new_theme, | 385 return new GtkThemeInstalledInfoBarDelegate(tab_contents, new_theme, |
| 391 previous_theme_id, previous_use_system_theme); | 386 previous_theme_id, previous_use_system_theme); |
| 392 #else | 387 #else |
| 393 return new ThemeInstalledInfoBarDelegate(tab_contents, new_theme, | 388 return new ThemeInstalledInfoBarDelegate(tab_contents, new_theme, |
| 394 previous_theme_id); | 389 previous_theme_id); |
| 395 #endif | 390 #endif |
| 396 } | 391 } |
| OLD | NEW |