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

Side by Side Diff: chrome/browser/ui/views/frame/glass_browser_frame_view.h

Issue 7155015: Store profile avatar to preferences (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 5 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_FRAME_GLASS_BROWSER_FRAME_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "chrome/browser/prefs/pref_member.h"
11 #include "chrome/browser/ui/views/frame/browser_frame_win.h" 10 #include "chrome/browser/ui/views/frame/browser_frame_win.h"
12 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" 11 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h"
12 #include "content/common/notification_observer.h"
13 #include "content/common/notification_registrar.h"
13 #include "views/controls/button/button.h" 14 #include "views/controls/button/button.h"
14 #include "views/window/non_client_view.h" 15 #include "views/window/non_client_view.h"
15 16
16 class BrowserView; 17 class BrowserView;
17 class AvatarMenuButton; 18 class AvatarMenuButton;
18 class SkBitmap; 19 class SkBitmap;
19 20
20 class GlassBrowserFrameView : public BrowserNonClientFrameView, 21 class GlassBrowserFrameView : public BrowserNonClientFrameView,
21 public NotificationObserver { 22 public NotificationObserver {
22 public: 23 public:
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 void StopThrobber(); 79 void StopThrobber();
79 80
80 // Displays the next throbber frame. 81 // Displays the next throbber frame.
81 void DisplayNextThrobberFrame(); 82 void DisplayNextThrobberFrame();
82 83
83 // NotificationObserver implementation: 84 // NotificationObserver implementation:
84 virtual void Observe(NotificationType type, 85 virtual void Observe(NotificationType type,
85 const NotificationSource& source, 86 const NotificationSource& source,
86 const NotificationDetails& details) OVERRIDE; 87 const NotificationDetails& details) OVERRIDE;
87 88
88 // Receive notifications when the user's Google services user name changes. 89 // Updates the title and icon of the avatar button.
89 void RegisterLoginNotifications(); 90 void UpdateAvatarInfo();
90 91
91 // The layout rect of the avatar icon, if visible. 92 // The layout rect of the avatar icon, if visible.
92 gfx::Rect avatar_bounds_; 93 gfx::Rect avatar_bounds_;
93 94
94 // The frame that hosts this view. 95 // The frame that hosts this view.
95 BrowserFrame* frame_; 96 BrowserFrame* frame_;
96 97
97 // The BrowserView hosted within this View. 98 // The BrowserView hosted within this View.
98 BrowserView* browser_view_; 99 BrowserView* browser_view_;
99 100
100 // The bounds of the ClientView. 101 // The bounds of the ClientView.
101 gfx::Rect client_view_bounds_; 102 gfx::Rect client_view_bounds_;
102 103
103 // Menu button that displays that either the incognito icon or the profile 104 // Menu button that displays that either the incognito icon or the profile
104 // icon. 105 // icon.
105 scoped_ptr<AvatarMenuButton> avatar_button_; 106 scoped_ptr<AvatarMenuButton> avatar_button_;
106 107
107 // Whether or not the window throbber is currently animating. 108 // Whether or not the window throbber is currently animating.
108 bool throbber_running_; 109 bool throbber_running_;
109 110
110 // The index of the current frame of the throbber animation. 111 // The index of the current frame of the throbber animation.
111 int throbber_frame_; 112 int throbber_frame_;
112 113
113 // The Google services user name associated with this BrowserView's profile. 114 NotificationRegistrar registrar_;
114 StringPrefMember username_pref_;
115 115
116 static const int kThrobberIconCount = 24; 116 static const int kThrobberIconCount = 24;
117 static HICON throbber_icons_[kThrobberIconCount]; 117 static HICON throbber_icons_[kThrobberIconCount];
118 static void InitThrobberIcons(); 118 static void InitThrobberIcons();
119 119
120 DISALLOW_COPY_AND_ASSIGN(GlassBrowserFrameView); 120 DISALLOW_COPY_AND_ASSIGN(GlassBrowserFrameView);
121 }; 121 };
122 122
123 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_ 123 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/browser/ui/views/frame/glass_browser_frame_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698