Chromium Code Reviews| 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->browser_action()) || !extension->omnibox_keyword().empty() || |
|
Nico
2012/08/23 15:42:12
Remove parens around first term
Finnur
2012/08/24 12:55:26
Done. I also removed browser_action_command() alto
| |
| 57 (extension->page_action() && | 57 (extension->page_action() && |
| 58 !extension->page_action()->default_icon_path().empty())) { | 58 !extension->page_action()->default_icon_path().empty()) || |
| 59 extension->browser_action_command() || extension->page_action_command()) { | |
|
Nico
2012/08/23 15:42:12
This condition is unreadable. Is it the same on al
Finnur
2012/08/24 12:55:26
Mac is the only platform that decided to show the
Aaron Boodman
2012/08/24 13:48:57
If it helps at all, we want to remove the infobar
| |
| 59 // The controller is deallocated when the window is closed, so no need to | 60 // The controller is deallocated when the window is closed, so no need to |
| 60 // worry about it here. | 61 // worry about it here. |
| 61 [[ExtensionInstalledBubbleController alloc] | 62 [[ExtensionInstalledBubbleController alloc] |
| 62 initWithParentWindow:browser->window()->GetNativeWindow() | 63 initWithParentWindow:browser->window()->GetNativeWindow() |
| 63 extension:extension | 64 extension:extension |
| 64 bundle:NULL | 65 bundle:NULL |
| 65 browser:browser | 66 browser:browser |
| 66 icon:icon]; | 67 icon:icon]; |
| 67 } else { | 68 } else { |
| 68 // If the extension is of type GENERIC, meaning it doesn't have a UI | 69 // 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 | 70 // surface to display for this window, launch infobar instead of popup |
| 70 // bubble, because we have no guaranteed wrench menu button to point to. | 71 // bubble, because we have no guaranteed wrench menu button to point to. |
| 71 ShowGenericExtensionInstalledInfoBar(extension, browser, icon); | 72 ShowGenericExtensionInstalledInfoBar(extension, browser, icon); |
| 72 } | 73 } |
| 73 } | 74 } |
| 74 | 75 |
| 75 } // namespace chrome | 76 } // namespace chrome |
| 76 | 77 |
| 77 void extensions::BundleInstaller::ShowInstalledBubble( | 78 void extensions::BundleInstaller::ShowInstalledBubble( |
| 78 const BundleInstaller* bundle, Browser* browser) { | 79 const BundleInstaller* bundle, Browser* browser) { |
| 79 // The controller is deallocated when the window is closed, so no need to | 80 // The controller is deallocated when the window is closed, so no need to |
| 80 // worry about it here. | 81 // worry about it here. |
| 81 [[ExtensionInstalledBubbleController alloc] | 82 [[ExtensionInstalledBubbleController alloc] |
| 82 initWithParentWindow:browser->window()->GetNativeWindow() | 83 initWithParentWindow:browser->window()->GetNativeWindow() |
| 83 extension:NULL | 84 extension:NULL |
| 84 bundle:bundle | 85 bundle:bundle |
| 85 browser:browser | 86 browser:browser |
| 86 icon:SkBitmap()]; | 87 icon:SkBitmap()]; |
| 87 } | 88 } |
| OLD | NEW |