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

Side by Side Diff: chrome/browser/ui/views/profiles/new_avatar_button.h

Issue 1701563002: Refactor ProfileInfoCache in c/b/ui/views (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to comments Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_UI_VIEWS_PROFILES_NEW_AVATAR_BUTTON_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_PROFILES_NEW_AVATAR_BUTTON_H_
6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_NEW_AVATAR_BUTTON_H_ 6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_NEW_AVATAR_BUTTON_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "chrome/browser/profiles/profile_info_cache_observer.h" 9 #include "chrome/browser/profiles/profile_attributes_storage.h"
10 #include "chrome/browser/ui/views/profiles/avatar_button_style.h" 10 #include "chrome/browser/ui/views/profiles/avatar_button_style.h"
11 #include "components/signin/core/browser/signin_error_controller.h" 11 #include "components/signin/core/browser/signin_error_controller.h"
12 #include "ui/views/controls/button/label_button.h" 12 #include "ui/views/controls/button/label_button.h"
13 13
14 class AvatarButtonDelegate; 14 class AvatarButtonDelegate;
15 class Profile; 15 class Profile;
16 16
17 // Avatar button that displays the active profile's name in the caption area. 17 // Avatar button that displays the active profile's name in the caption area.
18 class NewAvatarButton : public views::LabelButton, 18 class NewAvatarButton : public views::LabelButton,
19 public ProfileInfoCacheObserver, 19 public ProfileAttributesStorage::Observer,
20 public SigninErrorController::Observer { 20 public SigninErrorController::Observer {
21 public: 21 public:
22 NewAvatarButton(AvatarButtonDelegate* delegate, 22 NewAvatarButton(AvatarButtonDelegate* delegate,
23 AvatarButtonStyle button_style, 23 AvatarButtonStyle button_style,
24 Profile* profile); 24 Profile* profile);
25 ~NewAvatarButton() override; 25 ~NewAvatarButton() override;
26 26
27 // Views::LabelButton 27 // Views::LabelButton
28 bool OnMousePressed(const ui::MouseEvent& event) override; 28 bool OnMousePressed(const ui::MouseEvent& event) override;
29 void OnMouseReleased(const ui::MouseEvent& event) override; 29 void OnMouseReleased(const ui::MouseEvent& event) override;
30 30
31 // Views 31 // Views
32 void OnGestureEvent(ui::GestureEvent* event) override; 32 void OnGestureEvent(ui::GestureEvent* event) override;
33 33
34 private: 34 private:
35 friend class ProfileChooserViewExtensionsTest; 35 friend class ProfileChooserViewExtensionsTest;
36 36
37 // ProfileInfoCacheObserver: 37 // ProfileAttributesStorage::Observer:
38 void OnProfileAdded(const base::FilePath& profile_path) override; 38 void OnProfileAdded(const base::FilePath& profile_path) override;
39 void OnProfileWasRemoved(const base::FilePath& profile_path, 39 void OnProfileWasRemoved(const base::FilePath& profile_path,
40 const base::string16& profile_name) override; 40 const base::string16& profile_name) override;
41 void OnProfileNameChanged(const base::FilePath& profile_path, 41 void OnProfileNameChanged(const base::FilePath& profile_path,
42 const base::string16& old_profile_name) override; 42 const base::string16& old_profile_name) override;
43 void OnProfileSupervisedUserIdChanged( 43 void OnProfileSupervisedUserIdChanged(
44 const base::FilePath& profile_path) override; 44 const base::FilePath& profile_path) override;
45 45
46 // SigninErrorController::Observer: 46 // SigninErrorController::Observer:
47 void OnErrorChanged() override; 47 void OnErrorChanged() override;
(...skipping 15 matching lines...) Expand all
63 63
64 // This is used to check if the bubble was showing during the mouse pressed 64 // This is used to check if the bubble was showing during the mouse pressed
65 // event. If this is true then the mouse released event is ignored to prevent 65 // event. If this is true then the mouse released event is ignored to prevent
66 // the bubble from reshowing. 66 // the bubble from reshowing.
67 bool suppress_mouse_released_action_; 67 bool suppress_mouse_released_action_;
68 68
69 DISALLOW_COPY_AND_ASSIGN(NewAvatarButton); 69 DISALLOW_COPY_AND_ASSIGN(NewAvatarButton);
70 }; 70 };
71 71
72 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_NEW_AVATAR_BUTTON_H_ 72 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_NEW_AVATAR_BUTTON_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/profiles/avatar_menu_button.cc ('k') | chrome/browser/ui/views/profiles/new_avatar_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698