| OLD | NEW |
| 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 ViewObserver; |
| 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, ViewObserver* view_observer); |
| 30 ~OverviewButtonTray() override; | 31 ~OverviewButtonTray() override; |
| 31 | 32 |
| 32 // Updates the tray's visibility based on the LoginStatus and the current | 33 // Updates the tray's visibility based on the LoginStatus and the current |
| 33 // state of MaximizeMode | 34 // state of MaximizeMode |
| 34 virtual void UpdateAfterLoginStatusChange(LoginStatus status); | 35 virtual void UpdateAfterLoginStatusChange(LoginStatus status); |
| 35 | 36 |
| 36 // ActionableView: | 37 // ActionableView: |
| 37 bool PerformAction(const ui::Event& event) override; | 38 bool PerformAction(const ui::Event& event) override; |
| 38 | 39 |
| 39 // SessionStateObserver: | 40 // SessionStateObserver: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 50 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; | 51 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; |
| 51 void SetShelfAlignment(ShelfAlignment alignment) override; | 52 void SetShelfAlignment(ShelfAlignment alignment) override; |
| 52 | 53 |
| 53 private: | 54 private: |
| 54 friend class OverviewButtonTrayTest; | 55 friend class OverviewButtonTrayTest; |
| 55 | 56 |
| 56 // Creates a new border for the icon. The padding is determined based on the | 57 // Creates a new border for the icon. The padding is determined based on the |
| 57 // alignment of the shelf. | 58 // alignment of the shelf. |
| 58 void SetIconBorderForShelfAlignment(); | 59 void SetIconBorderForShelfAlignment(); |
| 59 | 60 |
| 61 // Sets an empty border around the overview tray to change user-visible size |
| 62 // of the dark background. Doesn't do anything in MD. |
| 63 void SetOverviewTrayBorder(); |
| 64 |
| 60 // Sets the icon to visible if maximize mode is enabled and | 65 // Sets the icon to visible if maximize mode is enabled and |
| 61 // WindowSelectorController::CanSelect. | 66 // WindowSelectorController::CanSelect. |
| 62 void UpdateIconVisibility(); | 67 void UpdateIconVisibility(); |
| 63 | 68 |
| 64 // Weak pointer, will be parented by TrayContainer for its lifetime. | 69 // Weak pointer, will be parented by TrayContainer for its lifetime. |
| 65 views::ImageView* icon_; | 70 views::ImageView* icon_; |
| 66 | 71 |
| 67 DISALLOW_COPY_AND_ASSIGN(OverviewButtonTray); | 72 DISALLOW_COPY_AND_ASSIGN(OverviewButtonTray); |
| 68 }; | 73 }; |
| 69 | 74 |
| 70 } // namespace ash | 75 } // namespace ash |
| 71 | 76 |
| 72 #endif // ASH_COMMON_SYSTEM_OVERVIEW_OVERVIEW_BUTTON_TRAY_H_ | 77 #endif // ASH_COMMON_SYSTEM_OVERVIEW_OVERVIEW_BUTTON_TRAY_H_ |
| OLD | NEW |