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

Side by Side Diff: ash/common/system/tray/tray_details_view.h

Issue 2494943005: [ash-md] Added a delay between system menu default/detailed view transitions. (Closed)
Patch Set: Addressed review comments. Created 4 years, 1 month 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 (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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // Overridden to handle button presses on subclass-specific buttons. 92 // Overridden to handle button presses on subclass-specific buttons.
86 virtual void HandleButtonPressed(views::Button* sender, 93 virtual void HandleButtonPressed(views::Button* sender,
87 const ui::Event& event); 94 const ui::Event& event);
88 95
89 // Creates and adds subclass-specific buttons to the title row. 96 // Creates and adds subclass-specific buttons to the title row.
90 virtual void CreateExtraTitleRowButtons(); 97 virtual void CreateExtraTitleRowButtons();
91 98
92 // Transition to default view from details view. If |title_row_| has focus 99 // Transition to default view from details view. If |title_row_| has focus
93 // before transition, the default view should focus on the owner of this 100 // before transition, the default view should focus on the owner of this
94 // details view. 101 // details view.
102 //
103 // In Material Design the actual transition is intentionally delayed to allow
104 // the user to perceive the ink drop animation on the clicked target.
95 void TransitionToDefaultView(); 105 void TransitionToDefaultView();
96 106
107 // Actually transitions to the default view.
108 void DoTransitionToDefaultView();
109
97 SystemTrayItem* owner_; 110 SystemTrayItem* owner_;
98 views::BoxLayout* box_layout_; 111 views::BoxLayout* box_layout_;
99 SpecialPopupRow* title_row_; 112 SpecialPopupRow* title_row_;
100 FixedSizedScrollView* scroller_; 113 FixedSizedScrollView* scroller_;
101 views::View* scroll_content_; 114 views::View* scroll_content_;
102 views::ProgressBar* progress_bar_; 115 views::ProgressBar* progress_bar_;
103 116
104 ScrollBorder* scroll_border_; // Weak reference 117 ScrollBorder* scroll_border_; // Weak reference
105 118
106 // The back button that appears in the material design title row. Not owned. 119 // The back button that appears in the material design title row. Not owned.
107 views::Button* back_button_; 120 views::Button* back_button_;
108 121
122 // Used to delay the transition to the default view.
123 std::unique_ptr<base::OneShotTimer> transition_delay_timer_;
124
109 DISALLOW_COPY_AND_ASSIGN(TrayDetailsView); 125 DISALLOW_COPY_AND_ASSIGN(TrayDetailsView);
110 }; 126 };
111 127
112 } // namespace ash 128 } // namespace ash
113 129
114 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ 130 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698