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

Side by Side Diff: chrome/browser/ui/cocoa/profile_menu_controller.mm

Issue 10388239: Make NetworkProfileBubble not use BrowserList::GetLastActive() as much. Instead pass it a profile a… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 "chrome/browser/ui/cocoa/profile_menu_controller.h" 5 #import "chrome/browser/ui/cocoa/profile_menu_controller.h"
6 6
7 #include "base/sys_string_conversions.h" 7 #include "base/sys_string_conversions.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/profiles/avatar_menu_model.h" 9 #include "chrome/browser/profiles/avatar_menu_model.h"
10 #include "chrome/browser/profiles/avatar_menu_model_observer.h" 10 #include "chrome/browser/profiles/avatar_menu_model_observer.h"
(...skipping 20 matching lines...) Expand all
31 public: 31 public:
32 Observer(ProfileMenuController* controller) : controller_(controller) { 32 Observer(ProfileMenuController* controller) : controller_(controller) {
33 BrowserList::AddObserver(this); 33 BrowserList::AddObserver(this);
34 } 34 }
35 35
36 ~Observer() { 36 ~Observer() {
37 BrowserList::RemoveObserver(this); 37 BrowserList::RemoveObserver(this);
38 } 38 }
39 39
40 // BrowserList::Observer: 40 // BrowserList::Observer:
41 virtual void OnBrowserAdded(const Browser* browser) {} 41 virtual void OnBrowserAdded(Browser* browser) {}
42 virtual void OnBrowserRemoved(const Browser* browser) { 42 virtual void OnBrowserRemoved(Browser* browser) {
43 [controller_ activeBrowserChangedTo:BrowserList::GetLastActive()]; 43 [controller_ activeBrowserChangedTo:BrowserList::GetLastActive()];
44 } 44 }
45 virtual void OnBrowserSetLastActive(const Browser* browser) { 45 virtual void OnBrowserSetLastActive(Browser* browser) {
46 [controller_ activeBrowserChangedTo:const_cast<Browser*>(browser)]; 46 [controller_ activeBrowserChangedTo:browser];
47 } 47 }
48 48
49 // AvatarMenuModelObserver: 49 // AvatarMenuModelObserver:
50 virtual void OnAvatarMenuModelChanged(AvatarMenuModel* model) { 50 virtual void OnAvatarMenuModelChanged(AvatarMenuModel* model) {
51 [controller_ rebuildMenu]; 51 [controller_ rebuildMenu];
52 } 52 }
53 53
54 private: 54 private:
55 ProfileMenuController* controller_; // Weak; owns this. 55 ProfileMenuController* controller_; // Weak; owns this.
56 }; 56 };
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 } 166 }
167 167
168 - (NSMenuItem*)createItemWithTitle:(NSString*)title action:(SEL)sel { 168 - (NSMenuItem*)createItemWithTitle:(NSString*)title action:(SEL)sel {
169 scoped_nsobject<NSMenuItem> item( 169 scoped_nsobject<NSMenuItem> item(
170 [[NSMenuItem alloc] initWithTitle:title action:sel keyEquivalent:@""]); 170 [[NSMenuItem alloc] initWithTitle:title action:sel keyEquivalent:@""]);
171 [item setTarget:self]; 171 [item setTarget:self];
172 return [item.release() autorelease]; 172 return [item.release() autorelease];
173 } 173 }
174 174
175 @end 175 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698