| 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/extensions/bundle_installer.h" | 9 #include "chrome/browser/extensions/bundle_installer.h" |
| 10 #include "chrome/browser/infobars/infobar_tab_helper.h" | 10 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 const extensions::Extension* extension, | 58 const extensions::Extension* extension, |
| 59 Browser* browser, | 59 Browser* browser, |
| 60 const SkBitmap& icon, | 60 const SkBitmap& icon, |
| 61 Profile* profile) { | 61 Profile* profile) { |
| 62 if ((extension->browser_action()) || !extension->omnibox_keyword().empty() || | 62 if ((extension->browser_action()) || !extension->omnibox_keyword().empty() || |
| 63 (extension->page_action() && | 63 (extension->page_action() && |
| 64 !extension->page_action()->default_icon_path().empty())) { | 64 !extension->page_action()->default_icon_path().empty())) { |
| 65 // The controller is deallocated when the window is closed, so no need to | 65 // The controller is deallocated when the window is closed, so no need to |
| 66 // worry about it here. | 66 // worry about it here. |
| 67 [[ExtensionInstalledBubbleController alloc] | 67 [[ExtensionInstalledBubbleController alloc] |
| 68 initWithParentWindow:browser->window()->GetNativeHandle() | 68 initWithParentWindow:browser->window()->GetNativeWindow() |
| 69 extension:extension | 69 extension:extension |
| 70 bundle:NULL | 70 bundle:NULL |
| 71 browser:browser | 71 browser:browser |
| 72 icon:icon]; | 72 icon:icon]; |
| 73 } else { | 73 } else { |
| 74 // If the extension is of type GENERIC, meaning it doesn't have a UI | 74 // If the extension is of type GENERIC, meaning it doesn't have a UI |
| 75 // surface to display for this window, launch infobar instead of popup | 75 // surface to display for this window, launch infobar instead of popup |
| 76 // bubble, because we have no guaranteed wrench menu button to point to. | 76 // bubble, because we have no guaranteed wrench menu button to point to. |
| 77 ShowGenericExtensionInstalledInfoBar(extension, icon, profile); | 77 ShowGenericExtensionInstalledInfoBar(extension, icon, profile); |
| 78 } | 78 } |
| 79 } | 79 } |
| 80 | 80 |
| 81 } // namespace browser | 81 } // namespace browser |
| 82 | 82 |
| 83 void extensions::BundleInstaller::ShowInstalledBubble( | 83 void extensions::BundleInstaller::ShowInstalledBubble( |
| 84 const BundleInstaller* bundle, Browser* browser) { | 84 const BundleInstaller* bundle, Browser* browser) { |
| 85 // The controller is deallocated when the window is closed, so no need to | 85 // The controller is deallocated when the window is closed, so no need to |
| 86 // worry about it here. | 86 // worry about it here. |
| 87 [[ExtensionInstalledBubbleController alloc] | 87 [[ExtensionInstalledBubbleController alloc] |
| 88 initWithParentWindow:browser->window()->GetNativeHandle() | 88 initWithParentWindow:browser->window()->GetNativeWindow() |
| 89 extension:NULL | 89 extension:NULL |
| 90 bundle:bundle | 90 bundle:bundle |
| 91 browser:browser | 91 browser:browser |
| 92 icon:SkBitmap()]; | 92 icon:SkBitmap()]; |
| 93 } | 93 } |
| OLD | NEW |