| 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" | 9 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" |
| 10 #include "chrome/browser/api/infobars/simple_alert_infobar_delegate.h" | 10 #include "chrome/browser/api/infobars/simple_alert_infobar_delegate.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 InfoBarDelegate* delegate = new SimpleAlertInfoBarDelegate( | 46 InfoBarDelegate* delegate = new SimpleAlertInfoBarDelegate( |
| 47 infobar_helper, new gfx::Image(icon), msg, true); | 47 infobar_helper, new gfx::Image(icon), msg, true); |
| 48 infobar_helper->AddInfoBar(delegate); | 48 infobar_helper->AddInfoBar(delegate); |
| 49 } | 49 } |
| 50 | 50 |
| 51 namespace chrome { | 51 namespace chrome { |
| 52 | 52 |
| 53 void ShowExtensionInstalledBubble(const extensions::Extension* extension, | 53 void ShowExtensionInstalledBubble(const extensions::Extension* extension, |
| 54 Browser* browser, | 54 Browser* browser, |
| 55 const SkBitmap& icon) { | 55 const SkBitmap& icon) { |
| 56 if ((extension->browser_action()) || !extension->omnibox_keyword().empty() || | 56 if (extension->is_verbose_install_message()) { |
| 57 (extension->page_action() && | |
| 58 !extension->page_action()->default_icon_path().empty())) { | |
| 59 // The controller is deallocated when the window is closed, so no need to | 57 // The controller is deallocated when the window is closed, so no need to |
| 60 // worry about it here. | 58 // worry about it here. |
| 61 [[ExtensionInstalledBubbleController alloc] | 59 [[ExtensionInstalledBubbleController alloc] |
| 62 initWithParentWindow:browser->window()->GetNativeWindow() | 60 initWithParentWindow:browser->window()->GetNativeWindow() |
| 63 extension:extension | 61 extension:extension |
| 64 bundle:NULL | 62 bundle:NULL |
| 65 browser:browser | 63 browser:browser |
| 66 icon:icon]; | 64 icon:icon]; |
| 67 } else { | 65 } else { |
| 68 // If the extension is of type GENERIC, meaning it doesn't have a UI | 66 // If the extension is of type GENERIC, meaning it doesn't have a UI |
| 69 // surface to display for this window, launch infobar instead of popup | 67 // surface to display for this window, launch infobar instead of popup |
| 70 // bubble, because we have no guaranteed wrench menu button to point to. | 68 // bubble, because we have no guaranteed wrench menu button to point to. |
| 71 ShowGenericExtensionInstalledInfoBar(extension, browser, icon); | 69 ShowGenericExtensionInstalledInfoBar(extension, browser, icon); |
| 72 } | 70 } |
| 73 } | 71 } |
| 74 | 72 |
| 75 } // namespace chrome | 73 } // namespace chrome |
| 76 | 74 |
| 77 void extensions::BundleInstaller::ShowInstalledBubble( | 75 void extensions::BundleInstaller::ShowInstalledBubble( |
| 78 const BundleInstaller* bundle, Browser* browser) { | 76 const BundleInstaller* bundle, Browser* browser) { |
| 79 // The controller is deallocated when the window is closed, so no need to | 77 // The controller is deallocated when the window is closed, so no need to |
| 80 // worry about it here. | 78 // worry about it here. |
| 81 [[ExtensionInstalledBubbleController alloc] | 79 [[ExtensionInstalledBubbleController alloc] |
| 82 initWithParentWindow:browser->window()->GetNativeWindow() | 80 initWithParentWindow:browser->window()->GetNativeWindow() |
| 83 extension:NULL | 81 extension:NULL |
| 84 bundle:bundle | 82 bundle:bundle |
| 85 browser:browser | 83 browser:browser |
| 86 icon:SkBitmap()]; | 84 icon:SkBitmap()]; |
| 87 } | 85 } |
| OLD | NEW |