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)) { | |
240 // If the toolbar redesign is enabled, all bubbles for extensions point to | 239 // If the toolbar redesign is enabled, all bubbles for extensions point to |
241 // their toolbar action. The exception is for bundles, for which there is no | 240 // their toolbar action. |
242 // single associated extension. | |
243 BrowserActionsController* controller = | 241 BrowserActionsController* controller = |
244 [[window->cocoa_controller() toolbarController] | 242 [[window->cocoa_controller() toolbarController] |
245 browserActionsController]; | 243 browserActionsController]; |
246 arrowPoint = [controller popupPointForId:[self extension]->id()]; | 244 arrowPoint = [controller popupPointForId:[self extension]->id()]; |
247 } else if (type_ == extension_installed_bubble::kPageAction) { | 245 } else if (type_ == extension_installed_bubble::kPageAction) { |
248 LocationBarViewMac* locationBarView = | 246 LocationBarViewMac* locationBarView = |
249 [window->cocoa_controller() locationBarBridge]; | 247 [window->cocoa_controller() locationBarBridge]; |
250 | 248 |
251 ExtensionAction* page_action = | 249 ExtensionAction* page_action = |
252 extensions::ExtensionActionManager::Get(browser_->profile())-> | 250 extensions::ExtensionActionManager::Get(browser_->profile())-> |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 install_ui->OpenAppInstalledUI([self extension]->id()); | 606 install_ui->OpenAppInstalledUI([self extension]->id()); |
609 } | 607 } |
610 | 608 |
611 - (void)awakeFromNib { | 609 - (void)awakeFromNib { |
612 if (bundle_) | 610 if (bundle_) |
613 return; | 611 return; |
614 [self initializeLabel]; | 612 [self initializeLabel]; |
615 } | 613 } |
616 | 614 |
617 @end | 615 @end |
OLD | NEW |