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

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

Issue 2957043002: Add a row in the network tray to inform users to turn Bluetooth on to enable Tether. (Closed)
Patch Set: khorimoto@ and jamescook@ comments Created 3 years, 5 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 (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_DETAILS_VIEW_H_ 5 #ifndef ASH_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_
6 #define ASH_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ 6 #define ASH_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
11 #include "ash/system/tray/actionable_view.h"
Kyle Horimoto 2017/07/12 22:45:58 Remove.
lesliewatkins 2017/07/13 22:12:47 Done.
11 #include "ash/system/tray/tray_constants.h" 12 #include "ash/system/tray/tray_constants.h"
12 #include "ash/system/tray/view_click_listener.h" 13 #include "ash/system/tray/view_click_listener.h"
13 #include "base/macros.h" 14 #include "base/macros.h"
14 #include "base/timer/timer.h" 15 #include "base/timer/timer.h"
15 #include "ui/views/controls/button/button.h" 16 #include "ui/views/controls/button/button.h"
17 #include "ui/views/controls/button/label_button.h"
Kyle Horimoto 2017/07/12 22:45:58 Remove.
lesliewatkins 2017/07/13 22:12:47 Done.
16 #include "ui/views/view.h" 18 #include "ui/views/view.h"
17 19
18 namespace gfx { 20 namespace gfx {
19 struct VectorIcon; 21 struct VectorIcon;
20 } // namespace gfx 22 } // namespace gfx
21 23
22 namespace views { 24 namespace views {
23 class BoxLayout; 25 class BoxLayout;
24 class CustomButton; 26 class CustomButton;
25 class Label;
26 class ProgressBar; 27 class ProgressBar;
27 class ScrollView; 28 class ScrollView;
28 } // namespace views 29 } // namespace views
29 30
30 namespace ash { 31 namespace ash {
31 namespace test { 32 namespace test {
32 class TrayDetailsViewTest; 33 class TrayDetailsViewTest;
33 } // namespace test 34 } // namespace test
34 35
35 class HoverHighlightView; 36 class HoverHighlightView;
(...skipping 11 matching lines...) Expand all
47 // ViewClickListener: 48 // ViewClickListener:
48 // Don't override this --- override HandleViewClicked. 49 // Don't override this --- override HandleViewClicked.
49 void OnViewClicked(views::View* sender) final; 50 void OnViewClicked(views::View* sender) final;
50 51
51 // views::ButtonListener: 52 // views::ButtonListener:
52 // Don't override this --- override HandleButtonPressed. 53 // Don't override this --- override HandleButtonPressed.
53 void ButtonPressed(views::Button* sender, const ui::Event& event) final; 54 void ButtonPressed(views::Button* sender, const ui::Event& event) final;
54 55
55 SystemTrayItem* owner() { return owner_; } 56 SystemTrayItem* owner() { return owner_; }
56 57
57 protected: 58 // A delegate for handling actions when an InfoLabel is clicked.
58 // A view containing only a label, which is to be inserted as a non-targetable 59 class TrayDetailClickHandler {
Kyle Horimoto 2017/07/12 22:45:58 Remove.
lesliewatkins 2017/07/13 22:12:47 Done.
59 // row within a system menu detailed view (e.g., the "Scanning for devices..."
60 // message that can appear at the top of the Bluetooth detailed view).
61 class InfoLabel : public View {
62 public: 60 public:
63 explicit InfoLabel(int message_id); 61 virtual ~TrayDetailClickHandler(){};
64 ~InfoLabel() override; 62 virtual void OnTrayDetailClicked(int message_id) = 0;
65 63 virtual bool TrayDetailIsClickable(int message_id) = 0;
66 void SetMessage(int message_id);
67
68 private:
69 views::Label* const label_;
70
71 DISALLOW_COPY_AND_ASSIGN(InfoLabel);
72 }; 64 };
73 65
66 protected:
74 // views::View: 67 // views::View:
75 void Layout() override; 68 void Layout() override;
76 int GetHeightForWidth(int width) const override; 69 int GetHeightForWidth(int width) const override;
77 70
78 // Exposes the layout manager of this view to give control to subclasses. 71 // Exposes the layout manager of this view to give control to subclasses.
79 views::BoxLayout* box_layout() { return box_layout_; } 72 views::BoxLayout* box_layout() { return box_layout_; }
80 73
81 // Creates the row containing the back button and title. For material design 74 // Creates the row containing the back button and title. For material design
82 // this appears at the top of the view, for non-material design it appears 75 // this appears at the top of the view, for non-material design it appears
83 // at the bottom. 76 // at the bottom.
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 172
180 // Used to delay the transition to the default view. 173 // Used to delay the transition to the default view.
181 base::OneShotTimer transition_delay_timer_; 174 base::OneShotTimer transition_delay_timer_;
182 175
183 DISALLOW_COPY_AND_ASSIGN(TrayDetailsView); 176 DISALLOW_COPY_AND_ASSIGN(TrayDetailsView);
184 }; 177 };
185 178
186 } // namespace ash 179 } // namespace ash
187 180
188 #endif // ASH_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ 181 #endif // ASH_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698