Index: chrome/browser/ui/cocoa/extensions/extension_installed_bubble_bridge.mm |
diff --git a/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_bridge.mm b/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_bridge.mm |
index b11a3b50834925722165379d7801805d4193e650..bd089309afe94b6b266a0d95d60884fd2a44757b 100644 |
--- a/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_bridge.mm |
+++ b/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_bridge.mm |
@@ -4,72 +4,28 @@ |
#import <Cocoa/Cocoa.h> |
-#include "base/i18n/rtl.h" |
-#include "base/utf_string_conversions.h" |
-#include "chrome/browser/api/infobars/confirm_infobar_delegate.h" |
-#include "chrome/browser/api/infobars/simple_alert_infobar_delegate.h" |
#include "chrome/browser/extensions/bundle_installer.h" |
-#include "chrome/browser/infobars/infobar_tab_helper.h" |
#include "chrome/browser/ui/browser.h" |
-#include "chrome/browser/ui/browser_dialogs.h" |
-#include "chrome/browser/ui/browser_tabstrip.h" |
#include "chrome/browser/ui/browser_window.h" |
#import "chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.h" |
-#include "chrome/browser/ui/tab_contents/tab_contents.h" |
#include "chrome/common/extensions/extension.h" |
-#include "chrome/common/extensions/extension_action.h" |
-#include "grit/chromium_strings.h" |
-#include "grit/generated_resources.h" |
-#include "ui/base/l10n/l10n_util.h" |
-#include "ui/gfx/image/image.h" |
+#include "third_party/skia/include/core/SkBitmap.h" |
using extensions::BundleInstaller; |
-// When an extension is installed on Mac with neither browser action nor |
-// page action icons, show an infobar instead of a popup bubble. |
-static void ShowGenericExtensionInstalledInfoBar( |
- const extensions::Extension* new_extension, |
- Browser* browser, |
- const SkBitmap& icon) { |
- TabContents* tab_contents = chrome::GetActiveTabContents(browser); |
- if (!tab_contents) |
- return; |
- |
- string16 extension_name = UTF8ToUTF16(new_extension->name()); |
- base::i18n::AdjustStringForLocaleDirection(&extension_name); |
- string16 msg = l10n_util::GetStringFUTF16(IDS_EXTENSION_INSTALLED_HEADING, |
- extension_name) |
- + UTF8ToUTF16(" ") |
- + l10n_util::GetStringUTF16( |
- IDS_EXTENSION_INSTALLED_MANAGE_INFO_MAC); |
- InfoBarTabHelper* infobar_helper = tab_contents->infobar_tab_helper(); |
- InfoBarDelegate* delegate = new SimpleAlertInfoBarDelegate( |
- infobar_helper, new gfx::Image(icon), msg, true); |
- infobar_helper->AddInfoBar(delegate); |
-} |
- |
namespace chrome { |
void ShowExtensionInstalledBubble(const extensions::Extension* extension, |
Browser* browser, |
const SkBitmap& icon) { |
- if ((extension->browser_action()) || !extension->omnibox_keyword().empty() || |
- (extension->page_action() && |
- !extension->page_action()->default_icon_path().empty())) { |
- // The controller is deallocated when the window is closed, so no need to |
- // worry about it here. |
- [[ExtensionInstalledBubbleController alloc] |
- initWithParentWindow:browser->window()->GetNativeWindow() |
- extension:extension |
- bundle:NULL |
- browser:browser |
- icon:icon]; |
- } else { |
- // If the extension is of type GENERIC, meaning it doesn't have a UI |
- // surface to display for this window, launch infobar instead of popup |
- // bubble, because we have no guaranteed wrench menu button to point to. |
- ShowGenericExtensionInstalledInfoBar(extension, browser, icon); |
- } |
+ // The controller is deallocated when the window is closed, so no need to |
+ // worry about it here. |
+ [[ExtensionInstalledBubbleController alloc] |
+ initWithParentWindow:browser->window()->GetNativeWindow() |
+ extension:extension |
+ bundle:NULL |
+ browser:browser |
+ icon:icon]; |
} |
} // namespace chrome |
@@ -79,9 +35,9 @@ void extensions::BundleInstaller::ShowInstalledBubble( |
// The controller is deallocated when the window is closed, so no need to |
// worry about it here. |
[[ExtensionInstalledBubbleController alloc] |
- initWithParentWindow:browser->window()->GetNativeWindow() |
- extension:NULL |
- bundle:bundle |
- browser:browser |
- icon:SkBitmap()]; |
+ initWithParentWindow:browser->window()->GetNativeWindow() |
+ extension:NULL |
+ bundle:bundle |
+ browser:browser |
+ icon:SkBitmap()]; |
} |