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

Side by Side Diff: ash/common/system/status_area_widget.h

Issue 2557593009: Fix Chrome crashes on calling OnTrayVisibilityChange (Closed)
Patch Set: address comments Created 4 years 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_STATUS_AREA_WIDGET_H_ 5 #ifndef ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_H_
6 #define ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_H_ 6 #define ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/common/login_status.h" 9 #include "ash/common/login_status.h"
10 #include "ash/common/shelf/shelf_background_animator_observer.h" 10 #include "ash/common/shelf/shelf_background_animator_observer.h"
11 #include "ash/public/cpp/shelf_types.h" 11 #include "ash/public/cpp/shelf_types.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "ui/views/widget/widget.h" 13 #include "ui/views/widget/widget.h"
14 14
15 namespace ash { 15 namespace ash {
16 class OverviewButtonTray; 16 class OverviewButtonTray;
17 class StatusAreaWidgetDelegate; 17 class StatusAreaWidgetDelegate;
18 class SystemTray; 18 class SystemTray;
19 class TrayBackgroundView; 19 class TrayBackgroundView;
20 class WebNotificationTray; 20 class WebNotificationTray;
21 class WmShelf; 21 class WmShelf;
22 class WmWindow; 22 class WmWindow;
23 #if defined(OS_CHROMEOS) 23 #if defined(OS_CHROMEOS)
24 class ImeMenuTray; 24 class ImeMenuTray;
25 class LogoutButtonTray; 25 class LogoutButtonTray;
26 class PaletteTray; 26 class PaletteTray;
27 class VirtualKeyboardTray; 27 class VirtualKeyboardTray;
28 #endif 28 #endif
29 29
30 namespace test {
31 class SystemTrayTest;
32 }
33
30 class ASH_EXPORT StatusAreaWidget : public views::Widget, 34 class ASH_EXPORT StatusAreaWidget : public views::Widget,
31 public ShelfBackgroundAnimatorObserver { 35 public ShelfBackgroundAnimatorObserver {
32 public: 36 public:
33 StatusAreaWidget(WmWindow* status_container, WmShelf* wm_shelf); 37 StatusAreaWidget(WmWindow* status_container, WmShelf* wm_shelf);
34 ~StatusAreaWidget() override; 38 ~StatusAreaWidget() override;
35 39
36 // Creates the SystemTray, WebNotificationTray and LogoutButtonTray. 40 // Creates the SystemTray, WebNotificationTray and LogoutButtonTray.
37 void CreateTrayViews(); 41 void CreateTrayViews();
38 42
39 // Destroys the system tray and web notification tray. Called before 43 // Destroys the system tray and web notification tray. Called before
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 void SchedulePaint(); 90 void SchedulePaint();
87 91
88 // Overridden from views::Widget: 92 // Overridden from views::Widget:
89 const ui::NativeTheme* GetNativeTheme() const override; 93 const ui::NativeTheme* GetNativeTheme() const override;
90 void OnNativeWidgetActivationChanged(bool active) override; 94 void OnNativeWidgetActivationChanged(bool active) override;
91 95
92 // ShelfBackgroundAnimatorObserver: 96 // ShelfBackgroundAnimatorObserver:
93 void UpdateShelfItemBackground(int alpha) override; 97 void UpdateShelfItemBackground(int alpha) override;
94 98
95 private: 99 private:
100 friend class test::SystemTrayTest;
101
96 void AddSystemTray(); 102 void AddSystemTray();
97 void AddWebNotificationTray(); 103 void AddWebNotificationTray();
98 #if defined(OS_CHROMEOS) 104 #if defined(OS_CHROMEOS)
99 void AddLogoutButtonTray(); 105 void AddLogoutButtonTray();
100 void AddPaletteTray(); 106 void AddPaletteTray();
101 void AddVirtualKeyboardTray(); 107 void AddVirtualKeyboardTray();
102 void AddImeMenuTray(); 108 void AddImeMenuTray();
103 109
104 // Checks if |tray| is the next visible tray to the left of 110 // Checks if |tray| is the next visible tray to the left of
105 // |logout_button_tray_|. Returns true if both are visible, false otherwise. 111 // |logout_button_tray_|. Returns true if both are visible, false otherwise.
(...skipping 15 matching lines...) Expand all
121 LoginStatus login_status_; 127 LoginStatus login_status_;
122 128
123 WmShelf* wm_shelf_; 129 WmShelf* wm_shelf_;
124 130
125 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidget); 131 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidget);
126 }; 132 };
127 133
128 } // namespace ash 134 } // namespace ash
129 135
130 #endif // ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_H_ 136 #endif // ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_H_
OLDNEW
« no previous file with comments | « no previous file | ash/common/system/status_area_widget.cc » ('j') | ash/common/system/status_area_widget.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698