| OLD | NEW |
| 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_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/profiles/profile_info_cache_observer.h" | 8 #include "chrome/browser/profiles/profile_attributes_storage.h" |
| 9 #include "ui/views/window/non_client_view.h" | 9 #include "ui/views/window/non_client_view.h" |
| 10 | 10 |
| 11 #if defined(FRAME_AVATAR_BUTTON) | 11 #if defined(FRAME_AVATAR_BUTTON) |
| 12 #include "chrome/browser/ui/views/frame/avatar_button_manager.h" | 12 #include "chrome/browser/ui/views/frame/avatar_button_manager.h" |
| 13 #endif | 13 #endif |
| 14 | 14 |
| 15 class AvatarMenuButton; | 15 class AvatarMenuButton; |
| 16 class BrowserFrame; | 16 class BrowserFrame; |
| 17 class BrowserView; | 17 class BrowserView; |
| 18 | 18 |
| 19 // A specialization of the NonClientFrameView object that provides additional | 19 // A specialization of the NonClientFrameView object that provides additional |
| 20 // Browser-specific methods. | 20 // Browser-specific methods. |
| 21 class BrowserNonClientFrameView : public views::NonClientFrameView, | 21 class BrowserNonClientFrameView : public views::NonClientFrameView, |
| 22 public ProfileInfoCacheObserver { | 22 public ProfileAttributesStorage::Observer { |
| 23 public: | 23 public: |
| 24 BrowserNonClientFrameView(BrowserFrame* frame, BrowserView* browser_view); | 24 BrowserNonClientFrameView(BrowserFrame* frame, BrowserView* browser_view); |
| 25 ~BrowserNonClientFrameView() override; | 25 ~BrowserNonClientFrameView() override; |
| 26 | 26 |
| 27 BrowserView* browser_view() const { return browser_view_; } | 27 BrowserView* browser_view() const { return browser_view_; } |
| 28 BrowserFrame* frame() const { return frame_; } | 28 BrowserFrame* frame() const { return frame_; } |
| 29 AvatarMenuButton* avatar_button() const { return avatar_button_; } | 29 AvatarMenuButton* avatar_button() const { return avatar_button_; } |
| 30 | 30 |
| 31 #if defined(FRAME_AVATAR_BUTTON) | 31 #if defined(FRAME_AVATAR_BUTTON) |
| 32 views::View* new_avatar_button() const { | 32 views::View* new_avatar_button() const { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // and button |style|. | 92 // and button |style|. |
| 93 virtual void UpdateNewAvatarButtonImpl() = 0; | 93 virtual void UpdateNewAvatarButtonImpl() = 0; |
| 94 | 94 |
| 95 #if defined(FRAME_AVATAR_BUTTON) | 95 #if defined(FRAME_AVATAR_BUTTON) |
| 96 // Updates the title of the avatar button displayed in the caption area. | 96 // Updates the title of the avatar button displayed in the caption area. |
| 97 // The button uses |style| to match the browser window style. | 97 // The button uses |style| to match the browser window style. |
| 98 void UpdateNewAvatarButton(const AvatarButtonStyle style); | 98 void UpdateNewAvatarButton(const AvatarButtonStyle style); |
| 99 #endif | 99 #endif |
| 100 | 100 |
| 101 private: | 101 private: |
| 102 // Overriden from ProfileInfoCacheObserver. | 102 // Overriden from ProfileAttributesStorage::Observer. |
| 103 void OnProfileAdded(const base::FilePath& profile_path) override; | 103 void OnProfileAdded(const base::FilePath& profile_path) override; |
| 104 void OnProfileWasRemoved(const base::FilePath& profile_path, | 104 void OnProfileWasRemoved(const base::FilePath& profile_path, |
| 105 const base::string16& profile_name) override; | 105 const base::string16& profile_name) override; |
| 106 void OnProfileAvatarChanged(const base::FilePath& profile_path) override; | 106 void OnProfileAvatarChanged(const base::FilePath& profile_path) override; |
| 107 | 107 |
| 108 // Draws a taskbar icon if avatars are enabled, erases it otherwise. | 108 // Draws a taskbar icon if avatars are enabled, erases it otherwise. |
| 109 void UpdateTaskbarDecoration(); | 109 void UpdateTaskbarDecoration(); |
| 110 | 110 |
| 111 // The frame that hosts this view. | 111 // The frame that hosts this view. |
| 112 BrowserFrame* frame_; | 112 BrowserFrame* frame_; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 127 | 127 |
| 128 namespace chrome { | 128 namespace chrome { |
| 129 | 129 |
| 130 // Provided by a browser_non_client_frame_view_factory_*.cc implementation | 130 // Provided by a browser_non_client_frame_view_factory_*.cc implementation |
| 131 BrowserNonClientFrameView* CreateBrowserNonClientFrameView( | 131 BrowserNonClientFrameView* CreateBrowserNonClientFrameView( |
| 132 BrowserFrame* frame, BrowserView* browser_view); | 132 BrowserFrame* frame, BrowserView* browser_view); |
| 133 | 133 |
| 134 } // namespace chrome | 134 } // namespace chrome |
| 135 | 135 |
| 136 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_H_ | 136 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_H_ |
| OLD | NEW |