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

Side by Side Diff: ash/system/session/logout_button_tray.h

Issue 2807693002: Make LogoutButtonTray a regular View (Closed)
Patch Set: Rebased Created 3 years, 8 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
« no previous file with comments | « ash/system/palette/palette_tray.cc ('k') | ash/system/session/logout_button_tray.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ASH_SYSTEM_SESSION_LOGOUT_BUTTON_TRAY_H_ 5 #ifndef ASH_SYSTEM_SESSION_LOGOUT_BUTTON_TRAY_H_
6 #define ASH_SYSTEM_SESSION_LOGOUT_BUTTON_TRAY_H_ 6 #define ASH_SYSTEM_SESSION_LOGOUT_BUTTON_TRAY_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/login_status.h"
10 #include "ash/system/session/logout_button_observer.h" 9 #include "ash/system/session/logout_button_observer.h"
11 #include "ash/system/tray/tray_background_view.h"
12 #include "base/macros.h" 10 #include "base/macros.h"
13 #include "base/time/time.h" 11 #include "base/time/time.h"
14 #include "ui/views/controls/button/button.h" 12 #include "ui/views/controls/button/button.h"
13 #include "ui/views/view.h"
15 14
16 namespace views { 15 namespace views {
17 class LabelButton; 16 class MdTextButton;
18 } 17 }
19 18
20 namespace ash { 19 namespace ash {
20 class TrayContainer;
21 class WmShelf;
21 22
22 // Adds a logout button to the launcher's status area if enabled by the 23 // Adds a logout button to the launcher's status area if enabled by the
23 // kShowLogoutButtonInTray pref. 24 // kShowLogoutButtonInTray pref.
24 // TODO(mohsen): This is not using much of the TrayBackgroundView functionality. 25 class ASH_EXPORT LogoutButtonTray : public views::View,
25 // Consider making this a regular View. See https://crbug.com/698134. 26 public LogoutButtonObserver,
26 class ASH_EXPORT LogoutButtonTray : public TrayBackgroundView, 27 public views::ButtonListener {
27 public LogoutButtonObserver {
28 public: 28 public:
29 explicit LogoutButtonTray(WmShelf* wm_shelf); 29 explicit LogoutButtonTray(WmShelf* wm_shelf);
30 ~LogoutButtonTray() override; 30 ~LogoutButtonTray() override;
31 31
32 // TrayBackgroundView: 32 void UpdateAfterLoginStatusChange();
33 void SetShelfAlignment(ShelfAlignment alignment) override; 33 void UpdateAfterShelfAlignmentChange();
34 base::string16 GetAccessibleNameForTray() override; 34
35 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; 35 // views::View:
36 void ClickedOutsideBubble() override; 36 void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
37 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
38 37
39 // LogoutButtonObserver: 38 // LogoutButtonObserver:
40 void OnShowLogoutButtonInTrayChanged(bool show) override; 39 void OnShowLogoutButtonInTrayChanged(bool show) override;
41 void OnLogoutDialogDurationChanged(base::TimeDelta duration) override; 40 void OnLogoutDialogDurationChanged(base::TimeDelta duration) override;
42 41
43 void UpdateAfterLoginStatusChange(LoginStatus login_status); 42 // views::ButtonListener:
43 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
44 44
45 private: 45 private:
46 void UpdateVisibility(); 46 void UpdateVisibility();
47 void UpdateButtonTextAndImage(LoginStatus login_status, 47 void UpdateButtonTextAndImage();
48 ShelfAlignment alignment);
49 48
50 views::LabelButton* button_; 49 WmShelf* const wm_shelf_;
51 LoginStatus login_status_; 50 TrayContainer* const container_;
51 views::MdTextButton* const button_;
52 bool show_logout_button_in_tray_; 52 bool show_logout_button_in_tray_;
53 base::TimeDelta dialog_duration_; 53 base::TimeDelta dialog_duration_;
54 54
55 DISALLOW_COPY_AND_ASSIGN(LogoutButtonTray); 55 DISALLOW_COPY_AND_ASSIGN(LogoutButtonTray);
56 }; 56 };
57 57
58 } // namespace ash 58 } // namespace ash
59 59
60 #endif // ASH_SYSTEM_SESSION_LOGOUT_BUTTON_TRAY_H_ 60 #endif // ASH_SYSTEM_SESSION_LOGOUT_BUTTON_TRAY_H_
OLDNEW
« no previous file with comments | « ash/system/palette/palette_tray.cc ('k') | ash/system/session/logout_button_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698