| OLD | NEW |
| 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 Loading... |
| 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_ |
| OLD | NEW |