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

Side by Side Diff: chrome/browser/profiles/avatar_menu.h

Issue 1972033002: Simplify some old avatar menu button code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reinstate ash browser test fix Created 4 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
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 #ifndef CHROME_BROWSER_PROFILES_AVATAR_MENU_H_ 5 #ifndef CHROME_BROWSER_PROFILES_AVATAR_MENU_H_
6 #define CHROME_BROWSER_PROFILES_AVATAR_MENU_H_ 6 #define CHROME_BROWSER_PROFILES_AVATAR_MENU_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // Constructor. |observer| can be NULL. |browser| can be NULL and a new one 90 // Constructor. |observer| can be NULL. |browser| can be NULL and a new one
91 // will be created if an action requires it. 91 // will be created if an action requires it.
92 AvatarMenu(ProfileAttributesStorage* profile_storage, 92 AvatarMenu(ProfileAttributesStorage* profile_storage,
93 AvatarMenuObserver* observer, 93 AvatarMenuObserver* observer,
94 Browser* browser); 94 Browser* browser);
95 ~AvatarMenu() override; 95 ~AvatarMenu() override;
96 96
97 // True if avatar menu should be displayed. 97 // True if avatar menu should be displayed.
98 static bool ShouldShowAvatarMenu(); 98 static bool ShouldShowAvatarMenu();
99 99
100 // Sets |image| to the avatar corresponding to the profile at |profile_path| 100 // Sets |image| to the avatar corresponding to the profile at |profile_path|.
101 // and sets |is_rectangle| to true unless |image| is a built-in profile 101 // For built-in profile avatars, returns the non-high res version.
102 // avatar. For built-in profile avatars, returns the non-high res version.
103 static void GetImageForMenuButton(const base::FilePath& profile_path, 102 static void GetImageForMenuButton(const base::FilePath& profile_path,
104 gfx::Image* image, 103 gfx::Image* image);
105 bool* is_rectangle);
106 104
107 // Opens a Browser with the specified profile in response to the user 105 // Opens a Browser with the specified profile in response to the user
108 // selecting an item. If |always_create| is true then a new window is created 106 // selecting an item. If |always_create| is true then a new window is created
109 // even if a window for that profile already exists. 107 // even if a window for that profile already exists.
110 void SwitchToProfile(size_t index, 108 void SwitchToProfile(size_t index,
111 bool always_create, 109 bool always_create,
112 ProfileMetrics::ProfileOpen metric); 110 ProfileMetrics::ProfileOpen metric);
113 111
114 // Creates a new profile. 112 // Creates a new profile.
115 void AddNewProfile(ProfileMetrics::ProfileAdd type); 113 void AddNewProfile(ProfileMetrics::ProfileAdd type);
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 // The observer of this model, which is notified of changes. Weak. 187 // The observer of this model, which is notified of changes. Weak.
190 AvatarMenuObserver* observer_; 188 AvatarMenuObserver* observer_;
191 189
192 // Browser in which this avatar menu resides. Weak. 190 // Browser in which this avatar menu resides. Weak.
193 Browser* browser_; 191 Browser* browser_;
194 192
195 DISALLOW_COPY_AND_ASSIGN(AvatarMenu); 193 DISALLOW_COPY_AND_ASSIGN(AvatarMenu);
196 }; 194 };
197 195
198 #endif // CHROME_BROWSER_PROFILES_AVATAR_MENU_H_ 196 #endif // CHROME_BROWSER_PROFILES_AVATAR_MENU_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/profiles/avatar_menu_chromeos.cc ('k') | chrome/browser/profiles/avatar_menu_desktop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698