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

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

Issue 12279015: Mac Chromium style checker cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 Browser* browser) 181 Browser* browser)
182 : owner_(owner), browser_(browser) { 182 : owner_(owner), browser_(browser) {
183 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE, 183 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE,
184 content::Source<Profile>(browser->profile())); 184 content::Source<Profile>(browser->profile()));
185 registrar_.Add(this, 185 registrar_.Add(this,
186 chrome::NOTIFICATION_EXTENSION_COMMAND_BROWSER_ACTION_MAC, 186 chrome::NOTIFICATION_EXTENSION_COMMAND_BROWSER_ACTION_MAC,
187 content::Source<Profile>(browser->profile())); 187 content::Source<Profile>(browser->profile()));
188 } 188 }
189 189
190 // Overridden from content::NotificationObserver. 190 // Overridden from content::NotificationObserver.
191 void Observe(int type, 191 virtual void Observe(
192 const content::NotificationSource& source, 192 int type,
193 const content::NotificationDetails& details) { 193 const content::NotificationSource& source,
194 const content::NotificationDetails& details) OVERRIDE {
194 switch (type) { 195 switch (type) {
195 case chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE: { 196 case chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE: {
196 ExtensionPopupController* popup = [ExtensionPopupController popup]; 197 ExtensionPopupController* popup = [ExtensionPopupController popup];
197 if (popup && ![popup isClosing]) 198 if (popup && ![popup isClosing])
198 [popup close]; 199 [popup close];
199 200
200 break; 201 break;
201 } 202 }
202 case chrome::NOTIFICATION_EXTENSION_COMMAND_BROWSER_ACTION_MAC: { 203 case chrome::NOTIFICATION_EXTENSION_COMMAND_BROWSER_ACTION_MAC: {
203 std::pair<const std::string, gfx::NativeWindow>* payload = 204 std::pair<const std::string, gfx::NativeWindow>* payload =
(...skipping 15 matching lines...) Expand all
219 if (button) 220 if (button)
220 [owner_ browserActionClicked:button]; 221 [owner_ browserActionClicked:button];
221 break; 222 break;
222 } 223 }
223 default: 224 default:
224 NOTREACHED() << L"Unexpected notification"; 225 NOTREACHED() << L"Unexpected notification";
225 } 226 }
226 } 227 }
227 228
228 // ExtensionToolbarModel::Observer implementation. 229 // ExtensionToolbarModel::Observer implementation.
229 void BrowserActionAdded(const Extension* extension, int index) { 230 virtual void BrowserActionAdded(
231 const Extension* extension,
232 int index) OVERRIDE {
230 [owner_ createActionButtonForExtension:extension withIndex:index]; 233 [owner_ createActionButtonForExtension:extension withIndex:index];
231 [owner_ resizeContainerAndAnimate:NO]; 234 [owner_ resizeContainerAndAnimate:NO];
232 } 235 }
233 236
234 void BrowserActionRemoved(const Extension* extension) { 237 virtual void BrowserActionRemoved(const Extension* extension) OVERRIDE {
235 [owner_ removeActionButtonForExtension:extension]; 238 [owner_ removeActionButtonForExtension:extension];
236 [owner_ resizeContainerAndAnimate:NO]; 239 [owner_ resizeContainerAndAnimate:NO];
237 } 240 }
238 241
239 private: 242 private:
240 // The object we need to inform when we get a notification. Weak. Owns us. 243 // The object we need to inform when we get a notification. Weak. Owns us.
241 BrowserActionsController* owner_; 244 BrowserActionsController* owner_;
242 245
243 // The browser we listen for events from. Weak. 246 // The browser we listen for events from. Weak.
244 Browser* browser_; 247 Browser* browser_;
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 const extensions::ExtensionList& toolbar_items = 877 const extensions::ExtensionList& toolbar_items =
875 toolbarModel_->toolbar_items(); 878 toolbarModel_->toolbar_items();
876 if (index < toolbar_items.size()) { 879 if (index < toolbar_items.size()) {
877 const Extension* extension = toolbar_items[index]; 880 const Extension* extension = toolbar_items[index];
878 return [buttons_ objectForKey:base::SysUTF8ToNSString(extension->id())]; 881 return [buttons_ objectForKey:base::SysUTF8ToNSString(extension->id())];
879 } 882 }
880 return nil; 883 return nil;
881 } 884 }
882 885
883 @end 886 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698