Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.mm

Issue 1363463002: [Extensions Toolbar] Add a finch config for the redesign (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Finnur's Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/location_bar_controller.cc ('k') | chrome/browser/ui/location_bar/location_bar_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698