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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 icon_ = *image; | 266 icon_ = *image; |
267 else | 267 else |
268 icon_ = SkBitmap(); | 268 icon_ = SkBitmap(); |
269 if (icon_.empty()) { | 269 if (icon_.empty()) { |
270 icon_ = *ResourceBundle::GetSharedInstance().GetBitmapNamed( | 270 icon_ = *ResourceBundle::GetSharedInstance().GetBitmapNamed( |
271 IDR_EXTENSION_DEFAULT_ICON); | 271 IDR_EXTENSION_DEFAULT_ICON); |
272 } | 272 } |
273 | 273 |
274 switch (prompt_type_) { | 274 switch (prompt_type_) { |
275 case INSTALL_PROMPT: { | 275 case INSTALL_PROMPT: { |
276 if (extension_->GetFullLaunchURL().is_valid()) { | 276 // TODO(jcivelli): http://crbug.com/44771 We should not show an install |
277 // Special case extension apps to not show the install dialog. | 277 // dialog when installing an app from the gallery. |
278 // TODO(finnur): http://crbug.com/42443: Don't do this for all apps. | |
279 delegate_->InstallUIProceed(false); // |create_app_shortcut|. | |
280 return; | |
281 } | |
282 | |
283 NotificationService* service = NotificationService::current(); | 278 NotificationService* service = NotificationService::current(); |
284 service->Notify(NotificationType::EXTENSION_WILL_SHOW_CONFIRM_DIALOG, | 279 service->Notify(NotificationType::EXTENSION_WILL_SHOW_CONFIRM_DIALOG, |
285 Source<ExtensionInstallUI>(this), | 280 Source<ExtensionInstallUI>(this), |
286 NotificationService::NoDetails()); | 281 NotificationService::NoDetails()); |
287 | 282 |
288 std::vector<string16> warnings; | 283 std::vector<string16> warnings; |
289 GetV2Warnings(extension_, &warnings); | 284 GetV2Warnings(extension_, &warnings); |
290 ShowExtensionInstallUIPrompt2Impl( | 285 ShowExtensionInstallUIPrompt2Impl( |
291 profile_, delegate_, extension_, &icon_, warnings); | 286 profile_, delegate_, extension_, &icon_, warnings); |
292 break; | 287 break; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 TabContents* tab_contents, Extension* new_theme, | 377 TabContents* tab_contents, Extension* new_theme, |
383 const std::string& previous_theme_id, bool previous_use_system_theme) { | 378 const std::string& previous_theme_id, bool previous_use_system_theme) { |
384 #if defined(TOOLKIT_GTK) | 379 #if defined(TOOLKIT_GTK) |
385 return new GtkThemeInstalledInfoBarDelegate(tab_contents, new_theme, | 380 return new GtkThemeInstalledInfoBarDelegate(tab_contents, new_theme, |
386 previous_theme_id, previous_use_system_theme); | 381 previous_theme_id, previous_use_system_theme); |
387 #else | 382 #else |
388 return new ThemeInstalledInfoBarDelegate(tab_contents, new_theme, | 383 return new ThemeInstalledInfoBarDelegate(tab_contents, new_theme, |
389 previous_theme_id); | 384 previous_theme_id); |
390 #endif | 385 #endif |
391 } | 386 } |
OLD | NEW |