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

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

Issue 738223002: [Extensions Toolbar Mac] Make new toolbar actions slide out from the right (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/browser_actions_controller.h" 5 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <string> 8 #include <string>
9 9
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 [item setTarget:self]; 412 [item setTarget:self];
413 [item setEnabled:[button isEnabled]]; 413 [item setEnabled:[button isEnabled]];
414 } 414 }
415 } 415 }
416 416
417 #pragma mark - 417 #pragma mark -
418 #pragma mark Private Methods 418 #pragma mark Private Methods
419 419
420 - (void)addViewForAction:(ToolbarActionViewController*)action 420 - (void)addViewForAction:(ToolbarActionViewController*)action
421 withIndex:(NSUInteger)index { 421 withIndex:(NSUInteger)index {
422 NSRect buttonFrame = NSMakeRect(0.0, 422 NSRect buttonFrame = NSMakeRect(NSMaxX([containerView_ bounds]),
423 kBrowserActionOriginYOffset, 423 kBrowserActionOriginYOffset,
424 ToolbarActionsBar::IconWidth(false), 424 ToolbarActionsBar::IconWidth(false),
425 ToolbarActionsBar::IconHeight()); 425 ToolbarActionsBar::IconHeight());
426 BrowserActionButton* newButton = 426 BrowserActionButton* newButton =
427 [[[BrowserActionButton alloc] 427 [[[BrowserActionButton alloc]
428 initWithFrame:buttonFrame 428 initWithFrame:buttonFrame
429 viewController:action 429 viewController:action
430 controller:self] autorelease]; 430 controller:self] autorelease];
431 [newButton setTarget:self]; 431 [newButton setTarget:self];
432 [newButton setAction:@selector(browserActionClicked:)]; 432 [newButton setAction:@selector(browserActionClicked:)];
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 759
760 - (BrowserActionButton*)buttonWithIndex:(NSUInteger)index { 760 - (BrowserActionButton*)buttonWithIndex:(NSUInteger)index {
761 const std::vector<ToolbarActionViewController*>& toolbar_actions = 761 const std::vector<ToolbarActionViewController*>& toolbar_actions =
762 toolbarActionsBar_->toolbar_actions(); 762 toolbarActionsBar_->toolbar_actions();
763 if (index < toolbar_actions.size()) 763 if (index < toolbar_actions.size())
764 return [self buttonForId:toolbar_actions[index]->GetId()]; 764 return [self buttonForId:toolbar_actions[index]->GetId()];
765 return nil; 765 return nil;
766 } 766 }
767 767
768 @end 768 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698