| 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_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ | 5 #ifndef ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ |
| 6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ | 6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 9 #include "ash/common/system/tray/special_popup_row.h" | 11 #include "ash/common/system/tray/special_popup_row.h" |
| 12 #include "ash/common/system/tray/tray_constants.h" |
| 10 #include "ash/common/system/tray/view_click_listener.h" | 13 #include "ash/common/system/tray/view_click_listener.h" |
| 11 #include "base/macros.h" | 14 #include "base/macros.h" |
| 12 #include "ui/views/controls/button/button.h" | 15 #include "ui/views/controls/button/button.h" |
| 13 #include "ui/views/view.h" | 16 #include "ui/views/view.h" |
| 14 | 17 |
| 18 namespace base { |
| 19 class OneShotTimer; |
| 20 } // namespace base |
| 21 |
| 15 namespace views { | 22 namespace views { |
| 16 class BoxLayout; | 23 class BoxLayout; |
| 17 class ScrollView; | 24 class ScrollView; |
| 18 class ProgressBar; | 25 class ProgressBar; |
| 19 } // namespace views | 26 } // namespace views |
| 20 | 27 |
| 21 namespace ash { | 28 namespace ash { |
| 22 namespace test { | 29 namespace test { |
| 23 class TrayDetailsViewTest; | 30 class TrayDetailsViewTest; |
| 24 } // namespace test | 31 } // namespace test |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // Overridden to handle button presses on subclass-specific buttons. | 89 // Overridden to handle button presses on subclass-specific buttons. |
| 83 virtual void HandleButtonPressed(views::Button* sender, | 90 virtual void HandleButtonPressed(views::Button* sender, |
| 84 const ui::Event& event); | 91 const ui::Event& event); |
| 85 | 92 |
| 86 // Creates and adds subclass-specific buttons to the title row. | 93 // Creates and adds subclass-specific buttons to the title row. |
| 87 virtual void CreateExtraTitleRowButtons(); | 94 virtual void CreateExtraTitleRowButtons(); |
| 88 | 95 |
| 89 // Transition to default view from details view. If |title_row_| has focus | 96 // Transition to default view from details view. If |title_row_| has focus |
| 90 // before transition, the default view should focus on the owner of this | 97 // before transition, the default view should focus on the owner of this |
| 91 // details view. | 98 // details view. |
| 99 // |
| 100 // In Material Design the actual transition is intentionally delayed to allow |
| 101 // the user to perceive the ink drop animation on the clicked target. |
| 92 void TransitionToDefaultView(); | 102 void TransitionToDefaultView(); |
| 93 | 103 |
| 104 // Actually transitions to the default view. |
| 105 void DoTransitionToDefaultView(); |
| 106 |
| 94 SystemTrayItem* owner_; | 107 SystemTrayItem* owner_; |
| 95 views::BoxLayout* box_layout_; | 108 views::BoxLayout* box_layout_; |
| 96 SpecialPopupRow* title_row_; | 109 SpecialPopupRow* title_row_; |
| 97 FixedSizedScrollView* scroller_; | 110 FixedSizedScrollView* scroller_; |
| 98 views::View* scroll_content_; | 111 views::View* scroll_content_; |
| 99 views::ProgressBar* progress_bar_; | 112 views::ProgressBar* progress_bar_; |
| 100 | 113 |
| 101 ScrollBorder* scroll_border_; // Weak reference | 114 ScrollBorder* scroll_border_; // Weak reference |
| 102 | 115 |
| 103 // The back button that appears in the material design title row. Not owned. | 116 // The back button that appears in the material design title row. Not owned. |
| 104 views::Button* back_button_; | 117 views::Button* back_button_; |
| 105 | 118 |
| 119 // Used to delay the transition to the default view. |
| 120 std::unique_ptr<base::OneShotTimer> transition_delay_timer_; |
| 121 |
| 106 DISALLOW_COPY_AND_ASSIGN(TrayDetailsView); | 122 DISALLOW_COPY_AND_ASSIGN(TrayDetailsView); |
| 107 }; | 123 }; |
| 108 | 124 |
| 109 } // namespace ash | 125 } // namespace ash |
| 110 | 126 |
| 111 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ | 127 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ |
| OLD | NEW |