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

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

Issue 10833056: Add a menu to the Action Box Button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Final changes! Created 8 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 | Annotate | Revision Log
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 "browser_actions_controller.h" 5 #import "browser_actions_controller.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <string> 8 #include <string>
9 9
10 #include "base/sys_string_conversions.h" 10 #include "base/sys_string_conversions.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 231
232 if ((self = [super init])) { 232 if ((self = [super init])) {
233 browser_ = browser; 233 browser_ = browser;
234 profile_ = browser->profile(); 234 profile_ = browser->profile();
235 235
236 if (!profile_->GetPrefs()->FindPreference( 236 if (!profile_->GetPrefs()->FindPreference(
237 prefs::kBrowserActionContainerWidth)) 237 prefs::kBrowserActionContainerWidth))
238 [BrowserActionsController registerUserPrefs:profile_->GetPrefs()]; 238 [BrowserActionsController registerUserPrefs:profile_->GetPrefs()];
239 239
240 observer_.reset(new ExtensionServiceObserverBridge(self, profile_)); 240 observer_.reset(new ExtensionServiceObserverBridge(self, profile_));
241 ExtensionService* extensionsService = profile_->GetExtensionService(); 241 ExtensionService* extensionService = profile_->GetExtensionService();
242 // |extensionsService| can be NULL in Incognito. 242 // |extensionService| can be NULL in Incognito.
243 if (extensionsService) { 243 if (extensionService) {
244 toolbarModel_ = extensionsService->toolbar_model(); 244 toolbarModel_ = extensionService->toolbar_model();
245 toolbarModel_->AddObserver(observer_.get()); 245 toolbarModel_->AddObserver(observer_.get());
246 } 246 }
247 247
248 containerView_ = container; 248 containerView_ = container;
249 [containerView_ setPostsFrameChangedNotifications:YES]; 249 [containerView_ setPostsFrameChangedNotifications:YES];
250 [[NSNotificationCenter defaultCenter] 250 [[NSNotificationCenter defaultCenter]
251 addObserver:self 251 addObserver:self
252 selector:@selector(containerFrameChanged:) 252 selector:@selector(containerFrameChanged:)
253 name:NSViewFrameDidChangeNotification 253 name:NSViewFrameDidChangeNotification
254 object:containerView_]; 254 object:containerView_];
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 const extensions::ExtensionList& toolbar_items = 833 const extensions::ExtensionList& toolbar_items =
834 toolbarModel_->toolbar_items(); 834 toolbarModel_->toolbar_items();
835 if (index < toolbar_items.size()) { 835 if (index < toolbar_items.size()) {
836 const Extension* extension = toolbar_items[index]; 836 const Extension* extension = toolbar_items[index];
837 return [buttons_ objectForKey:base::SysUTF8ToNSString(extension->id())]; 837 return [buttons_ objectForKey:base::SysUTF8ToNSString(extension->id())];
838 } 838 }
839 return nil; 839 return nil;
840 } 840 }
841 841
842 @end 842 @end
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698