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 "chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controlle
r.h" | 5 #import "chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controlle
r.h" |
6 | 6 |
7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 | 227 |
228 if (type_ == extension_installed_bubble::kApp) { | 228 if (type_ == extension_installed_bubble::kApp) { |
229 TabStripView* view = [window->cocoa_controller() tabStripView]; | 229 TabStripView* view = [window->cocoa_controller() tabStripView]; |
230 NewTabButton* button = [view getNewTabButton]; | 230 NewTabButton* button = [view getNewTabButton]; |
231 NSRect bounds = [button bounds]; | 231 NSRect bounds = [button bounds]; |
232 NSPoint anchor = NSMakePoint( | 232 NSPoint anchor = NSMakePoint( |
233 NSMidX(bounds), | 233 NSMidX(bounds), |
234 NSMaxY(bounds) - extension_installed_bubble::kAppsBubbleArrowOffset); | 234 NSMaxY(bounds) - extension_installed_bubble::kAppsBubbleArrowOffset); |
235 arrowPoint = [button convertPoint:anchor toView:nil]; | 235 arrowPoint = [button convertPoint:anchor toView:nil]; |
236 } else if (type_ == extension_installed_bubble::kBrowserAction || | 236 } else if (type_ == extension_installed_bubble::kBrowserAction || |
237 extensions::FeatureSwitch::extension_action_redesign()-> | 237 (extensions::FeatureSwitch::extension_action_redesign()-> |
238 IsEnabled()) { | 238 IsEnabled() && |
| 239 type_ != extension_installed_bubble::kBundle)) { |
239 // If the toolbar redesign is enabled, all bubbles for extensions point to | 240 // If the toolbar redesign is enabled, all bubbles for extensions point to |
240 // their toolbar action. | 241 // their toolbar action. The exception is for bundles, for which there is no |
| 242 // single associated extension. |
241 BrowserActionsController* controller = | 243 BrowserActionsController* controller = |
242 [[window->cocoa_controller() toolbarController] | 244 [[window->cocoa_controller() toolbarController] |
243 browserActionsController]; | 245 browserActionsController]; |
244 arrowPoint = [controller popupPointForId:[self extension]->id()]; | 246 arrowPoint = [controller popupPointForId:[self extension]->id()]; |
245 } else if (type_ == extension_installed_bubble::kPageAction) { | 247 } else if (type_ == extension_installed_bubble::kPageAction) { |
246 LocationBarViewMac* locationBarView = | 248 LocationBarViewMac* locationBarView = |
247 [window->cocoa_controller() locationBarBridge]; | 249 [window->cocoa_controller() locationBarBridge]; |
248 | 250 |
249 ExtensionAction* page_action = | 251 ExtensionAction* page_action = |
250 extensions::ExtensionActionManager::Get(browser_->profile())-> | 252 extensions::ExtensionActionManager::Get(browser_->profile())-> |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 install_ui->OpenAppInstalledUI([self extension]->id()); | 608 install_ui->OpenAppInstalledUI([self extension]->id()); |
607 } | 609 } |
608 | 610 |
609 - (void)awakeFromNib { | 611 - (void)awakeFromNib { |
610 if (bundle_) | 612 if (bundle_) |
611 return; | 613 return; |
612 [self initializeLabel]; | 614 [self initializeLabel]; |
613 } | 615 } |
614 | 616 |
615 @end | 617 @end |
OLD | NEW |