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

Side by Side Diff: ash/system/status_area_widget.cc

Issue 1949823002: WIP: Eliminate event.target() usage from TrayEventFilter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: container delegate Created 4 years, 7 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
« no previous file with comments | « ash/system/status_area_widget.h ('k') | ash/system/tray/system_tray.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "ash/system/status_area_widget.h" 5 #include "ash/system/status_area_widget.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/shelf/shelf_layout_manager.h" 8 #include "ash/shelf/shelf_layout_manager.h"
9 #include "ash/shelf/shelf_widget.h" 9 #include "ash/shelf/shelf_widget.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
11 #include "ash/shell_delegate.h" 11 #include "ash/shell_delegate.h"
12 #include "ash/shell_window_ids.h" 12 #include "ash/shell_window_ids.h"
13 #include "ash/system/bluetooth/bluetooth_observer.h" 13 #include "ash/system/bluetooth/bluetooth_observer.h"
14 #include "ash/system/overview/overview_button_tray.h" 14 #include "ash/system/overview/overview_button_tray.h"
15 #include "ash/system/status_area_widget_delegate.h" 15 #include "ash/system/status_area_widget_delegate.h"
16 #include "ash/system/tray/system_tray.h" 16 #include "ash/system/tray/system_tray.h"
17 #include "ash/system/tray/system_tray_delegate.h" 17 #include "ash/system/tray/system_tray_delegate.h"
18 #include "ash/system/web_notification/web_notification_tray.h" 18 #include "ash/system/web_notification/web_notification_tray.h"
19 #include "ash/wm/window_properties.h" 19 #include "ash/wm/window_properties.h"
20 #include "base/i18n/time_formatting.h" 20 #include "base/i18n/time_formatting.h"
21 #include "ui/aura/window.h" 21 #include "ui/aura/window.h"
22 22
23 #if defined(OS_CHROMEOS) 23 #if defined(OS_CHROMEOS)
24 #include "ash/system/chromeos/session/logout_button_tray.h" 24 #include "ash/system/chromeos/session/logout_button_tray.h"
25 #include "ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h" 25 #include "ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h"
26 #endif 26 #endif
27 27
28 namespace ash { 28 namespace ash {
29 29
30 const char StatusAreaWidget::kNativeViewName[] = "StatusAreaWidget";
31
32 StatusAreaWidget::StatusAreaWidget(aura::Window* status_container, 30 StatusAreaWidget::StatusAreaWidget(aura::Window* status_container,
33 ShelfWidget* shelf_widget) 31 ShelfWidget* shelf_widget)
34 : status_area_widget_delegate_(new StatusAreaWidgetDelegate), 32 : status_area_widget_delegate_(new StatusAreaWidgetDelegate),
35 overview_button_tray_(NULL), 33 overview_button_tray_(NULL),
36 system_tray_(NULL), 34 system_tray_(NULL),
37 web_notification_tray_(NULL), 35 web_notification_tray_(NULL),
38 #if defined(OS_CHROMEOS) 36 #if defined(OS_CHROMEOS)
39 logout_button_tray_(NULL), 37 logout_button_tray_(NULL),
40 virtual_keyboard_tray_(NULL), 38 virtual_keyboard_tray_(NULL),
41 #endif 39 #endif
42 login_status_(user::LOGGED_IN_NONE), 40 login_status_(user::LOGGED_IN_NONE),
43 shelf_widget_(shelf_widget) { 41 shelf_widget_(shelf_widget) {
44 views::Widget::InitParams params( 42 views::Widget::InitParams params(
45 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); 43 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
46 params.delegate = status_area_widget_delegate_; 44 params.delegate = status_area_widget_delegate_;
45 params.name = "StatusAreaWidget";
47 params.parent = status_container; 46 params.parent = status_container;
48 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 47 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
49 Init(params); 48 Init(params);
50 set_focus_on_creation(false); 49 set_focus_on_creation(false);
51 SetContentsView(status_area_widget_delegate_); 50 SetContentsView(status_area_widget_delegate_);
52 GetNativeView()->SetName(kNativeViewName);
53 } 51 }
54 52
55 StatusAreaWidget::~StatusAreaWidget() { 53 StatusAreaWidget::~StatusAreaWidget() {
56 } 54 }
57 55
58 void StatusAreaWidget::CreateTrayViews() { 56 void StatusAreaWidget::CreateTrayViews() {
59 AddOverviewButtonTray(); 57 AddOverviewButtonTray();
60 AddSystemTray(); 58 AddSystemTray();
61 AddWebNotificationTray(); 59 AddWebNotificationTray();
62 #if defined(OS_CHROMEOS) 60 #if defined(OS_CHROMEOS)
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 web_notification_tray_->UpdateAfterLoginStatusChange(login_status); 194 web_notification_tray_->UpdateAfterLoginStatusChange(login_status);
197 #if defined(OS_CHROMEOS) 195 #if defined(OS_CHROMEOS)
198 if (logout_button_tray_) 196 if (logout_button_tray_)
199 logout_button_tray_->UpdateAfterLoginStatusChange(login_status); 197 logout_button_tray_->UpdateAfterLoginStatusChange(login_status);
200 #endif 198 #endif
201 if (overview_button_tray_) 199 if (overview_button_tray_)
202 overview_button_tray_->UpdateAfterLoginStatusChange(login_status); 200 overview_button_tray_->UpdateAfterLoginStatusChange(login_status);
203 } 201 }
204 202
205 } // namespace ash 203 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/status_area_widget.h ('k') | ash/system/tray/system_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698