| 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 ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ | 5 #ifndef ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ |
| 6 #define ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ | 6 #define ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/shelf/background_animator.h" | 9 #include "ash/shelf/background_animator.h" |
| 10 #include "ash/shelf/shelf_types.h" | 10 #include "ash/shelf/shelf_types.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 class TrayContainer : public views::View { | 34 class TrayContainer : public views::View { |
| 35 public: | 35 public: |
| 36 explicit TrayContainer(ShelfAlignment alignment); | 36 explicit TrayContainer(ShelfAlignment alignment); |
| 37 virtual ~TrayContainer() {} | 37 virtual ~TrayContainer() {} |
| 38 | 38 |
| 39 void SetAlignment(ShelfAlignment alignment); | 39 void SetAlignment(ShelfAlignment alignment); |
| 40 | 40 |
| 41 void set_size(const gfx::Size& size) { size_ = size; } | 41 void set_size(const gfx::Size& size) { size_ = size; } |
| 42 | 42 |
| 43 // views::View: | 43 // views::View: |
| 44 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 44 virtual gfx::Size GetPreferredSize() const override; |
| 45 | 45 |
| 46 protected: | 46 protected: |
| 47 // views::View: | 47 // views::View: |
| 48 virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE; | 48 virtual void ChildPreferredSizeChanged(views::View* child) override; |
| 49 virtual void ChildVisibilityChanged(View* child) OVERRIDE; | 49 virtual void ChildVisibilityChanged(View* child) override; |
| 50 virtual void ViewHierarchyChanged( | 50 virtual void ViewHierarchyChanged( |
| 51 const ViewHierarchyChangedDetails& details) OVERRIDE; | 51 const ViewHierarchyChangedDetails& details) override; |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 void UpdateLayout(); | 54 void UpdateLayout(); |
| 55 | 55 |
| 56 ShelfAlignment alignment_; | 56 ShelfAlignment alignment_; |
| 57 gfx::Size size_; | 57 gfx::Size size_; |
| 58 | 58 |
| 59 DISALLOW_COPY_AND_ASSIGN(TrayContainer); | 59 DISALLOW_COPY_AND_ASSIGN(TrayContainer); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 explicit TrayBackgroundView(StatusAreaWidget* status_area_widget); | 62 explicit TrayBackgroundView(StatusAreaWidget* status_area_widget); |
| 63 virtual ~TrayBackgroundView(); | 63 virtual ~TrayBackgroundView(); |
| 64 | 64 |
| 65 // Called after the tray has been added to the widget containing it. | 65 // Called after the tray has been added to the widget containing it. |
| 66 virtual void Initialize(); | 66 virtual void Initialize(); |
| 67 | 67 |
| 68 // views::View: | 68 // views::View: |
| 69 virtual void SetVisible(bool visible) OVERRIDE; | 69 virtual void SetVisible(bool visible) override; |
| 70 virtual const char* GetClassName() const OVERRIDE; | 70 virtual const char* GetClassName() const override; |
| 71 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; | 71 virtual void OnMouseEntered(const ui::MouseEvent& event) override; |
| 72 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; | 72 virtual void OnMouseExited(const ui::MouseEvent& event) override; |
| 73 virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE; | 73 virtual void ChildPreferredSizeChanged(views::View* child) override; |
| 74 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 74 virtual void GetAccessibleState(ui::AXViewState* state) override; |
| 75 virtual void AboutToRequestFocusFromTabTraversal(bool reverse) OVERRIDE; | 75 virtual void AboutToRequestFocusFromTabTraversal(bool reverse) override; |
| 76 | 76 |
| 77 // ActionableView: | 77 // ActionableView: |
| 78 virtual bool PerformAction(const ui::Event& event) OVERRIDE; | 78 virtual bool PerformAction(const ui::Event& event) override; |
| 79 virtual gfx::Rect GetFocusBounds() OVERRIDE; | 79 virtual gfx::Rect GetFocusBounds() override; |
| 80 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | 80 virtual void OnGestureEvent(ui::GestureEvent* event) override; |
| 81 | 81 |
| 82 // BackgroundAnimatorDelegate: | 82 // BackgroundAnimatorDelegate: |
| 83 virtual void UpdateBackground(int alpha) OVERRIDE; | 83 virtual void UpdateBackground(int alpha) override; |
| 84 | 84 |
| 85 // Called whenever the shelf alignment changes. | 85 // Called whenever the shelf alignment changes. |
| 86 virtual void SetShelfAlignment(ShelfAlignment alignment); | 86 virtual void SetShelfAlignment(ShelfAlignment alignment); |
| 87 | 87 |
| 88 // Called when the anchor (tray or bubble) may have moved or changed. | 88 // Called when the anchor (tray or bubble) may have moved or changed. |
| 89 virtual void AnchorUpdated() {} | 89 virtual void AnchorUpdated() {} |
| 90 | 90 |
| 91 // Called from GetAccessibleState, must return a valid accessible name. | 91 // Called from GetAccessibleState, must return a valid accessible name. |
| 92 virtual base::string16 GetAccessibleNameForTray() = 0; | 92 virtual base::string16 GetAccessibleNameForTray() = 0; |
| 93 | 93 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 void UpdateBubbleViewArrow(views::TrayBubbleView* bubble_view); | 150 void UpdateBubbleViewArrow(views::TrayBubbleView* bubble_view); |
| 151 | 151 |
| 152 private: | 152 private: |
| 153 class TrayWidgetObserver; | 153 class TrayWidgetObserver; |
| 154 | 154 |
| 155 // Called from Initialize after all status area trays have been created. | 155 // Called from Initialize after all status area trays have been created. |
| 156 // Sets the border based on the position of the view. | 156 // Sets the border based on the position of the view. |
| 157 void SetTrayBorder(); | 157 void SetTrayBorder(); |
| 158 | 158 |
| 159 // ui::ImplicitAnimationObserver: | 159 // ui::ImplicitAnimationObserver: |
| 160 virtual void OnImplicitAnimationsCompleted() OVERRIDE; | 160 virtual void OnImplicitAnimationsCompleted() override; |
| 161 | 161 |
| 162 // Applies transformations to the |layer()| to animate the view when | 162 // Applies transformations to the |layer()| to animate the view when |
| 163 // SetVisible(false) is called. | 163 // SetVisible(false) is called. |
| 164 void HideTransformation(); | 164 void HideTransformation(); |
| 165 | 165 |
| 166 // Unowned pointer to parent widget. | 166 // Unowned pointer to parent widget. |
| 167 StatusAreaWidget* status_area_widget_; | 167 StatusAreaWidget* status_area_widget_; |
| 168 | 168 |
| 169 // Convenience pointer to the contents view. | 169 // Convenience pointer to the contents view. |
| 170 TrayContainer* tray_container_; | 170 TrayContainer* tray_container_; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 188 | 188 |
| 189 scoped_ptr<TrayWidgetObserver> widget_observer_; | 189 scoped_ptr<TrayWidgetObserver> widget_observer_; |
| 190 scoped_ptr<TrayEventFilter> tray_event_filter_; | 190 scoped_ptr<TrayEventFilter> tray_event_filter_; |
| 191 | 191 |
| 192 DISALLOW_COPY_AND_ASSIGN(TrayBackgroundView); | 192 DISALLOW_COPY_AND_ASSIGN(TrayBackgroundView); |
| 193 }; | 193 }; |
| 194 | 194 |
| 195 } // namespace ash | 195 } // namespace ash |
| 196 | 196 |
| 197 #endif // ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ | 197 #endif // ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ |
| OLD | NEW |