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

Side by Side Diff: ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h

Issue 2147143002: [Chrome OS MD] Draw a 1px separator between 2 tray items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 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 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_CHROMEOS_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_TRAY_H_ 5 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_TRAY_H_
6 #define ASH_COMMON_SYSTEM_CHROMEOS_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_TRAY_H_ 6 #define ASH_COMMON_SYSTEM_CHROMEOS_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_TRAY_H_
7 7
8 #include "ash/common/keyboard/keyboard_ui_observer.h" 8 #include "ash/common/keyboard/keyboard_ui_observer.h"
9 #include "ash/common/system/tray/tray_background_view.h" 9 #include "ash/common/system/tray/tray_background_view.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "ui/views/controls/button/button.h" 11 #include "ui/views/controls/button/button.h"
12 12
13 namespace views { 13 namespace views {
14 class ImageButton; 14 class ImageButton;
15 } 15 }
16 16
17 namespace ash { 17 namespace ash {
18 class LogoutButtonTray;
19 }
20
21 namespace ash {
varkha 2016/07/14 21:34:47 Don't need it second time.
yiyix 2016/07/26 20:27:30 Done.
18 22
19 // TODO(sky): make this visible on non-chromeos platforms. 23 // TODO(sky): make this visible on non-chromeos platforms.
20 class VirtualKeyboardTray : public TrayBackgroundView, 24 class VirtualKeyboardTray : public TrayBackgroundView,
21 public views::ButtonListener, 25 public views::ButtonListener,
22 public KeyboardUIObserver { 26 public KeyboardUIObserver {
23 public: 27 public:
24 explicit VirtualKeyboardTray(WmShelf* wm_shelf); 28 explicit VirtualKeyboardTray(WmShelf* wm_shelf);
25 ~VirtualKeyboardTray() override; 29 ~VirtualKeyboardTray() override;
26 30
31 // Resets internal pointers.
32 void Shutdown();
33
34 // Calls TrayBackgroundView::Initialize() and save a pointer to logout_button.
varkha 2016/07/14 21:34:47 nit: How about // Sets |logout_button_tray_| to |l
yiyix 2016/07/26 20:27:30 As we are using the new approach. we don't need to
35 void InitializeTrayItems(LogoutButtonTray* logout_button_tray);
varkha 2016/07/14 21:34:47 Hmm. Not sure if you need this method. Maybe simpl
yiyix 2016/07/26 20:27:30 Per our discussion offline, I will use observer de
36
27 // TrayBackgroundView: 37 // TrayBackgroundView:
28 void SetShelfAlignment(ShelfAlignment alignment) override; 38 void SetShelfAlignment(ShelfAlignment alignment) override;
29 base::string16 GetAccessibleNameForTray() override; 39 base::string16 GetAccessibleNameForTray() override;
30 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; 40 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override;
31 void ClickedOutsideBubble() override; 41 void ClickedOutsideBubble() override;
32 bool PerformAction(const ui::Event& event) override; 42 bool PerformAction(const ui::Event& event) override;
33 43
34 // views::ButtonListener: 44 // views::ButtonListener:
35 void ButtonPressed(views::Button* sender, const ui::Event& event) override; 45 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
36 46
37 // KeyboardUIObserver: 47 // KeyboardUIObserver:
38 void OnKeyboardEnabledStateChanged(bool new_value) override; 48 void OnKeyboardEnabledStateChanged(bool new_value) override;
39 49
40 private: 50 private:
51 // views::View:
52 void OnPaint(gfx::Canvas* canvas) override;
53
41 views::ImageButton* button_; // Not owned. 54 views::ImageButton* button_; // Not owned.
55 LogoutButtonTray* logout_button_tray_; // Not owned.
42 56
43 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardTray); 57 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardTray);
44 }; 58 };
45 59
46 } // namespace ash 60 } // namespace ash
47 61
48 #endif // ASH_COMMON_SYSTEM_CHROMEOS_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_TRAY_H_ 62 #endif // ASH_COMMON_SYSTEM_CHROMEOS_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_TRAY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698