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

Side by Side Diff: ash/common/system/overview/overview_button_tray.h

Issue 2147143002: [Chrome OS MD] Draw a 1px separator between 2 tray items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 4 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 ASH_COMMON_SYSTEM_OVERVIEW_OVERVIEW_BUTTON_TRAY_H_ 5 #ifndef ASH_COMMON_SYSTEM_OVERVIEW_OVERVIEW_BUTTON_TRAY_H_
6 #define ASH_COMMON_SYSTEM_OVERVIEW_OVERVIEW_BUTTON_TRAY_H_ 6 #define ASH_COMMON_SYSTEM_OVERVIEW_OVERVIEW_BUTTON_TRAY_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/common/session/session_state_observer.h" 9 #include "ash/common/session/session_state_observer.h"
10 #include "ash/common/shell_observer.h" 10 #include "ash/common/shell_observer.h"
11 #include "ash/common/system/tray/tray_background_view.h" 11 #include "ash/common/system/tray/tray_background_view.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 13
14 namespace views { 14 namespace views {
15 class ImageView; 15 class ImageView;
16 } 16 }
17 17
18 namespace ash { 18 namespace ash {
19 class WmShelfObserver;
19 20
20 // Status area tray for showing a toggle for Overview Mode. Overview Mode 21 // Status area tray for showing a toggle for Overview Mode. Overview Mode
21 // is equivalent to WindowSelectorController being in selection mode. 22 // is equivalent to WindowSelectorController being in selection mode.
22 // This hosts a ShellObserver that listens for the activation of Maximize Mode 23 // This hosts a ShellObserver that listens for the activation of Maximize Mode
23 // This tray will only be visible while in this state. This tray does not 24 // This tray will only be visible while in this state. This tray does not
24 // provide any bubble view windows. 25 // provide any bubble view windows.
25 class ASH_EXPORT OverviewButtonTray : public TrayBackgroundView, 26 class ASH_EXPORT OverviewButtonTray : public TrayBackgroundView,
26 public SessionStateObserver, 27 public SessionStateObserver,
27 public ShellObserver { 28 public ShellObserver {
28 public: 29 public:
29 explicit OverviewButtonTray(WmShelf* wm_shelf); 30 explicit OverviewButtonTray(WmShelf* wm_shelf,
James Cook 2016/08/09 00:25:17 ditto
yiyix 2016/08/11 01:23:18 Done.
31 WmShelfObserver* wm_shelf_observer);
30 ~OverviewButtonTray() override; 32 ~OverviewButtonTray() override;
31 33
32 // Updates the tray's visibility based on the LoginStatus and the current 34 // Updates the tray's visibility based on the LoginStatus and the current
33 // state of MaximizeMode 35 // state of MaximizeMode
34 virtual void UpdateAfterLoginStatusChange(LoginStatus status); 36 virtual void UpdateAfterLoginStatusChange(LoginStatus status);
35 37
36 // ActionableView: 38 // ActionableView:
37 bool PerformAction(const ui::Event& event) override; 39 bool PerformAction(const ui::Event& event) override;
38 40
39 // SessionStateObserver: 41 // SessionStateObserver:
(...skipping 10 matching lines...) Expand all
50 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; 52 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override;
51 void SetShelfAlignment(ShelfAlignment alignment) override; 53 void SetShelfAlignment(ShelfAlignment alignment) override;
52 54
53 private: 55 private:
54 friend class OverviewButtonTrayTest; 56 friend class OverviewButtonTrayTest;
55 57
56 // Creates a new border for the icon. The padding is determined based on the 58 // Creates a new border for the icon. The padding is determined based on the
57 // alignment of the shelf. 59 // alignment of the shelf.
58 void SetIconBorderForShelfAlignment(); 60 void SetIconBorderForShelfAlignment();
59 61
62 // Sets an empty border around the overview tray to change user-visible size
63 // of the dark background. Doesn't do anything in MD.
64 void SetOverviewTrayBorder();
65
60 // Sets the icon to visible if maximize mode is enabled and 66 // Sets the icon to visible if maximize mode is enabled and
61 // WindowSelectorController::CanSelect. 67 // WindowSelectorController::CanSelect.
62 void UpdateIconVisibility(); 68 void UpdateIconVisibility();
63 69
64 // Weak pointer, will be parented by TrayContainer for its lifetime. 70 // Weak pointer, will be parented by TrayContainer for its lifetime.
65 views::ImageView* icon_; 71 views::ImageView* icon_;
66 72
67 DISALLOW_COPY_AND_ASSIGN(OverviewButtonTray); 73 DISALLOW_COPY_AND_ASSIGN(OverviewButtonTray);
68 }; 74 };
69 75
70 } // namespace ash 76 } // namespace ash
71 77
72 #endif // ASH_COMMON_SYSTEM_OVERVIEW_OVERVIEW_BUTTON_TRAY_H_ 78 #endif // ASH_COMMON_SYSTEM_OVERVIEW_OVERVIEW_BUTTON_TRAY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698