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

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

Issue 1241063003: Support Component Actions in the toolbar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switch GetComponentActionId to unix_hacker_style. Created 5 years, 4 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/browser_actions_controller.h" 5 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "chrome/browser/extensions/extension_message_bubble_controller.h" 10 #include "chrome/browser/extensions/extension_message_bubble_controller.h"
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 [containerView_ setMaxDesiredWidth:toolbarActionsBar_->GetMaximumWidth()]; 556 [containerView_ setMaxDesiredWidth:toolbarActionsBar_->GetMaximumWidth()];
557 } 557 }
558 558
559 - (void)redraw { 559 - (void)redraw {
560 if (![self updateContainerVisibility]) 560 if (![self updateContainerVisibility])
561 return; // Container is hidden; no need to update. 561 return; // Container is hidden; no need to update.
562 562
563 scoped_ptr<ui::NinePartImageIds> highlight; 563 scoped_ptr<ui::NinePartImageIds> highlight;
564 if (toolbarActionsBar_->is_highlighting()) { 564 if (toolbarActionsBar_->is_highlighting()) {
565 if (toolbarActionsBar_->highlight_type() == 565 if (toolbarActionsBar_->highlight_type() ==
566 extensions::ExtensionToolbarModel::HIGHLIGHT_INFO) 566 ToolbarActionsModel::HIGHLIGHT_INFO)
567 highlight.reset( 567 highlight.reset(
568 new ui::NinePartImageIds(IMAGE_GRID(IDR_TOOLBAR_ACTION_HIGHLIGHT))); 568 new ui::NinePartImageIds(IMAGE_GRID(IDR_TOOLBAR_ACTION_HIGHLIGHT)));
569 else 569 else
570 highlight.reset( 570 highlight.reset(
571 new ui::NinePartImageIds(IMAGE_GRID(IDR_DEVELOPER_MODE_HIGHLIGHT))); 571 new ui::NinePartImageIds(IMAGE_GRID(IDR_DEVELOPER_MODE_HIGHLIGHT)));
572 } 572 }
573 [containerView_ setHighlight:highlight.Pass()]; 573 [containerView_ setHighlight:highlight.Pass()];
574 574
575 std::vector<ToolbarActionViewController*> toolbar_actions = 575 std::vector<ToolbarActionViewController*> toolbar_actions =
576 toolbarActionsBar_->GetActions(); 576 toolbarActionsBar_->GetActions();
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 } 1043 }
1044 1044
1045 #pragma mark - 1045 #pragma mark -
1046 #pragma mark Testing Methods 1046 #pragma mark Testing Methods
1047 1047
1048 - (BrowserActionButton*)buttonWithIndex:(NSUInteger)index { 1048 - (BrowserActionButton*)buttonWithIndex:(NSUInteger)index {
1049 return index < [buttons_ count] ? [buttons_ objectAtIndex:index] : nil; 1049 return index < [buttons_ count] ? [buttons_ objectAtIndex:index] : nil;
1050 } 1050 }
1051 1051
1052 @end 1052 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698