Commit 51df1c17 authored by estade's avatar estade Committed by Commit bot

Remove non-cros support from ash/common/system.

BUG=666773

Review-Url: https://codereview.chromium.org/2591553002
Cr-Commit-Position: refs/heads/master@{#439856}
parent 797ecc9d
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#include "ash/common/system/tray/tray_popup_header_button.h" #include "ash/common/system/tray/tray_popup_header_button.h"
#include "ash/common/wm_shell.h" #include "ash/common/wm_shell.h"
#include "base/i18n/rtl.h" #include "base/i18n/rtl.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/session_manager_client.h"
#include "grit/ash_resources.h" #include "grit/ash_resources.h"
#include "grit/ash_strings.h" #include "grit/ash_strings.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
...@@ -23,11 +25,6 @@ ...@@ -23,11 +25,6 @@
#include "ui/views/layout/fill_layout.h" #include "ui/views/layout/fill_layout.h"
#include "ui/views/view.h" #include "ui/views/view.h"
#if defined(OS_CHROMEOS)
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/session_manager_client.h"
#endif
namespace { namespace {
// The ISO-639 code for the Hebrew locale. The help icon asset is a '?' which is // The ISO-639 code for the Hebrew locale. The help icon asset is a '?' which is
...@@ -80,7 +77,6 @@ DateDefaultView::DateDefaultView(SystemTrayItem* owner, LoginStatus login) ...@@ -80,7 +77,6 @@ DateDefaultView::DateDefaultView(SystemTrayItem* owner, LoginStatus login)
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_HELP)); l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_HELP));
view->AddViewToRowNonMd(help_button_, true); view->AddViewToRowNonMd(help_button_, true);
#if !defined(OS_WIN)
if (login != LoginStatus::LOCKED) { if (login != LoginStatus::LOCKED) {
shutdown_button_ = new TrayPopupHeaderButton( shutdown_button_ = new TrayPopupHeaderButton(
this, IDR_AURA_UBER_TRAY_SHUTDOWN, IDR_AURA_UBER_TRAY_SHUTDOWN, this, IDR_AURA_UBER_TRAY_SHUTDOWN, IDR_AURA_UBER_TRAY_SHUTDOWN,
...@@ -105,7 +101,6 @@ DateDefaultView::DateDefaultView(SystemTrayItem* owner, LoginStatus login) ...@@ -105,7 +101,6 @@ DateDefaultView::DateDefaultView(SystemTrayItem* owner, LoginStatus login)
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_LOCK)); l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_LOCK));
view->AddViewToRowNonMd(lock_button_, true); view->AddViewToRowNonMd(lock_button_, true);
} }
#endif // !defined(OS_WIN)
} }
DateDefaultView::~DateDefaultView() {} DateDefaultView::~DateDefaultView() {}
...@@ -137,11 +132,9 @@ void DateDefaultView::ButtonPressed(views::Button* sender, ...@@ -137,11 +132,9 @@ void DateDefaultView::ButtonPressed(views::Button* sender,
shell->RequestShutdown(); shell->RequestShutdown();
} else if (sender == lock_button_) { } else if (sender == lock_button_) {
shell->RecordUserMetricsAction(UMA_TRAY_LOCK_SCREEN); shell->RecordUserMetricsAction(UMA_TRAY_LOCK_SCREEN);
#if defined(OS_CHROMEOS)
chromeos::DBusThreadManager::Get() chromeos::DBusThreadManager::Get()
->GetSessionManagerClient() ->GetSessionManagerClient()
->RequestLockScreen(); ->RequestLockScreen();
#endif
} else { } else {
NOTREACHED(); NOTREACHED();
} }
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "ash/common/system/date/system_info_default_view.h" #include "ash/common/system/date/system_info_default_view.h"
#include "ash/common/system/chromeos/power/power_status.h"
#include "ash/common/system/chromeos/power/power_status_view.h"
#include "ash/common/system/date/date_view.h" #include "ash/common/system/date/date_view.h"
#include "ash/common/system/tray/tray_constants.h" #include "ash/common/system/tray/tray_constants.h"
#include "ash/common/system/tray/tray_popup_utils.h" #include "ash/common/system/tray/tray_popup_utils.h"
...@@ -13,11 +15,6 @@ ...@@ -13,11 +15,6 @@
#include "ui/views/layout/box_layout.h" #include "ui/views/layout/box_layout.h"
#include "ui/views/layout/fill_layout.h" #include "ui/views/layout/fill_layout.h"
#if defined(OS_CHROMEOS)
#include "ash/common/system/chromeos/power/power_status.h"
#include "ash/common/system/chromeos/power/power_status_view.h"
#endif // defined(OS_CHROMEOS)
namespace ash { namespace ash {
// The minimum number of menu button widths that the date view should span // The minimum number of menu button widths that the date view should span
...@@ -38,7 +35,6 @@ SystemInfoDefaultView::SystemInfoDefaultView(SystemTrayItem* owner, ...@@ -38,7 +35,6 @@ SystemInfoDefaultView::SystemInfoDefaultView(SystemTrayItem* owner,
date_view_ = new tray::DateView(owner); date_view_ = new tray::DateView(owner);
tri_view_->AddView(TriView::Container::START, date_view_); tri_view_->AddView(TriView::Container::START, date_view_);
#if defined(OS_CHROMEOS)
if (PowerStatus::Get()->IsBatteryPresent()) { if (PowerStatus::Get()->IsBatteryPresent()) {
power_status_view_ = new ash::PowerStatusView(false); power_status_view_ = new ash::PowerStatusView(false);
std::unique_ptr<views::BoxLayout> box_layout = std::unique_ptr<views::BoxLayout> box_layout =
...@@ -55,7 +51,6 @@ SystemInfoDefaultView::SystemInfoDefaultView(SystemTrayItem* owner, ...@@ -55,7 +51,6 @@ SystemInfoDefaultView::SystemInfoDefaultView(SystemTrayItem* owner,
TrayPopupUtils::CreateVerticalSeparator()); TrayPopupUtils::CreateVerticalSeparator());
tri_view_->AddView(TriView::Container::CENTER, power_status_view_); tri_view_->AddView(TriView::Container::CENTER, power_status_view_);
} }
#endif // defined(OS_CHROMEOS)
tri_view_->SetContainerVisible(TriView::Container::END, false); tri_view_->SetContainerVisible(TriView::Container::END, false);
if (TrayPopupUtils::CanOpenWebUISettings(login)) if (TrayPopupUtils::CanOpenWebUISettings(login))
......
...@@ -11,9 +11,7 @@ ...@@ -11,9 +11,7 @@
#include "ui/views/view.h" #include "ui/views/view.h"
namespace ash { namespace ash {
#if defined(OS_CHROMEOS)
class PowerStatusView; class PowerStatusView;
#endif // defined(OS_CHROMEOS)
class SystemTrayItem; class SystemTrayItem;
class TriView; class TriView;
...@@ -48,9 +46,7 @@ class ASH_EXPORT SystemInfoDefaultView : public views::View { ...@@ -48,9 +46,7 @@ class ASH_EXPORT SystemInfoDefaultView : public views::View {
tray::DateView* date_view_; tray::DateView* date_view_;
#if defined(OS_CHROMEOS)
PowerStatusView* power_status_view_ = nullptr; PowerStatusView* power_status_view_ = nullptr;
#endif // defined(OS_CHROMEOS)
TriView* tri_view_; TriView* tri_view_;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "ash/common/system/date/tray_date.h" #include "ash/common/system/date/tray_date.h"
#include "ash/common/shelf/wm_shelf_util.h" #include "ash/common/shelf/wm_shelf_util.h"
#include "ash/common/system/chromeos/system_clock_observer.h"
#include "ash/common/system/date/date_default_view.h" #include "ash/common/system/date/date_default_view.h"
#include "ash/common/system/date/date_view.h" #include "ash/common/system/date/date_view.h"
#include "ash/common/system/tray/system_tray.h" #include "ash/common/system/tray/system_tray.h"
...@@ -12,20 +13,14 @@ ...@@ -12,20 +13,14 @@
#include "ash/common/system/tray/tray_item_view.h" #include "ash/common/system/tray/tray_item_view.h"
#include "ash/common/wm_shell.h" #include "ash/common/wm_shell.h"
#if defined(OS_CHROMEOS)
#include "ash/common/system/chromeos/system_clock_observer.h"
#endif
namespace ash { namespace ash {
TrayDate::TrayDate(SystemTray* system_tray) TrayDate::TrayDate(SystemTray* system_tray)
: SystemTrayItem(system_tray, UMA_DATE), : SystemTrayItem(system_tray, UMA_DATE),
time_tray_(NULL), time_tray_(NULL),
default_view_(NULL), default_view_(NULL),
login_status_(LoginStatus::NOT_LOGGED_IN) { login_status_(LoginStatus::NOT_LOGGED_IN),
#if defined(OS_CHROMEOS) system_clock_observer_(new SystemClockObserver()) {
system_clock_observer_.reset(new SystemClockObserver());
#endif
WmShell::Get()->system_tray_notifier()->AddClockObserver(this); WmShell::Get()->system_tray_notifier()->AddClockObserver(this);
} }
...@@ -66,12 +61,10 @@ views::View* TrayDate::CreateTrayView(LoginStatus status) { ...@@ -66,12 +61,10 @@ views::View* TrayDate::CreateTrayView(LoginStatus status) {
views::View* TrayDate::CreateDefaultView(LoginStatus status) { views::View* TrayDate::CreateDefaultView(LoginStatus status) {
default_view_ = new DateDefaultView(this, status); default_view_ = new DateDefaultView(this, status);
#if defined(OS_CHROMEOS)
// Save the login status we created the view with. // Save the login status we created the view with.
login_status_ = status; login_status_ = status;
OnSystemClockCanSetTimeChanged(system_clock_observer_->can_set_time()); OnSystemClockCanSetTimeChanged(system_clock_observer_->can_set_time());
#endif
return default_view_; return default_view_;
} }
......
...@@ -15,9 +15,7 @@ ...@@ -15,9 +15,7 @@
namespace ash { namespace ash {
class DateDefaultView; class DateDefaultView;
#if defined(OS_CHROMEOS)
class SystemClockObserver; class SystemClockObserver;
#endif
namespace tray { namespace tray {
class TimeView; class TimeView;
...@@ -68,9 +66,7 @@ class ASH_EXPORT TrayDate : public SystemTrayItem, public ClockObserver { ...@@ -68,9 +66,7 @@ class ASH_EXPORT TrayDate : public SystemTrayItem, public ClockObserver {
DateDefaultView* default_view_; DateDefaultView* default_view_;
LoginStatus login_status_; LoginStatus login_status_;
#if defined(OS_CHROMEOS)
std::unique_ptr<SystemClockObserver> system_clock_observer_; std::unique_ptr<SystemClockObserver> system_clock_observer_;
#endif
DISALLOW_COPY_AND_ASSIGN(TrayDate); DISALLOW_COPY_AND_ASSIGN(TrayDate);
}; };
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "ash/common/system/date/tray_system_info.h" #include "ash/common/system/date/tray_system_info.h"
#include "ash/common/shelf/wm_shelf_util.h" #include "ash/common/shelf/wm_shelf_util.h"
#include "ash/common/system/chromeos/system_clock_observer.h"
#include "ash/common/system/date/date_view.h" #include "ash/common/system/date/date_view.h"
#include "ash/common/system/date/system_info_default_view.h" #include "ash/common/system/date/system_info_default_view.h"
#include "ash/common/system/tray/system_tray.h" #include "ash/common/system/tray/system_tray.h"
...@@ -12,20 +13,14 @@ ...@@ -12,20 +13,14 @@
#include "ash/common/system/tray/tray_item_view.h" #include "ash/common/system/tray/tray_item_view.h"
#include "ash/common/wm_shell.h" #include "ash/common/wm_shell.h"
#if defined(OS_CHROMEOS)
#include "ash/common/system/chromeos/system_clock_observer.h"
#endif
namespace ash { namespace ash {
TraySystemInfo::TraySystemInfo(SystemTray* system_tray) TraySystemInfo::TraySystemInfo(SystemTray* system_tray)
: SystemTrayItem(system_tray, UMA_DATE), : SystemTrayItem(system_tray, UMA_DATE),
tray_view_(nullptr), tray_view_(nullptr),
default_view_(nullptr), default_view_(nullptr),
login_status_(LoginStatus::NOT_LOGGED_IN) { login_status_(LoginStatus::NOT_LOGGED_IN),
#if defined(OS_CHROMEOS) system_clock_observer_(new SystemClockObserver()) {
system_clock_observer_.reset(new SystemClockObserver());
#endif
WmShell::Get()->system_tray_notifier()->AddClockObserver(this); WmShell::Get()->system_tray_notifier()->AddClockObserver(this);
} }
...@@ -60,12 +55,10 @@ views::View* TraySystemInfo::CreateTrayView(LoginStatus status) { ...@@ -60,12 +55,10 @@ views::View* TraySystemInfo::CreateTrayView(LoginStatus status) {
views::View* TraySystemInfo::CreateDefaultView(LoginStatus status) { views::View* TraySystemInfo::CreateDefaultView(LoginStatus status) {
default_view_ = new SystemInfoDefaultView(this, status); default_view_ = new SystemInfoDefaultView(this, status);
#if defined(OS_CHROMEOS)
// Save the login status we created the view with. // Save the login status we created the view with.
login_status_ = status; login_status_ = status;
OnSystemClockCanSetTimeChanged(system_clock_observer_->can_set_time()); OnSystemClockCanSetTimeChanged(system_clock_observer_->can_set_time());
#endif
return default_view_; return default_view_;
} }
......
...@@ -5,9 +5,7 @@ ...@@ -5,9 +5,7 @@
#ifndef ASH_COMMON_SYSTEM_DATE_TRAY_SYSTEM_INFO_H_ #ifndef ASH_COMMON_SYSTEM_DATE_TRAY_SYSTEM_INFO_H_
#define ASH_COMMON_SYSTEM_DATE_TRAY_SYSTEM_INFO_H_ #define ASH_COMMON_SYSTEM_DATE_TRAY_SYSTEM_INFO_H_
#if defined(OS_CHROMEOS)
#include <memory> #include <memory>
#endif // defined(OS_CHROMEOS)
#include "ash/ash_export.h" #include "ash/ash_export.h"
#include "ash/common/login_status.h" #include "ash/common/login_status.h"
...@@ -20,10 +18,8 @@ class Label; ...@@ -20,10 +18,8 @@ class Label;
} }
namespace ash { namespace ash {
class SystemInfoDefaultView;
#if defined(OS_CHROMEOS)
class SystemClockObserver; class SystemClockObserver;
#endif class SystemInfoDefaultView;
namespace tray { namespace tray {
class TimeView; class TimeView;
...@@ -61,9 +57,7 @@ class ASH_EXPORT TraySystemInfo : public SystemTrayItem, public ClockObserver { ...@@ -61,9 +57,7 @@ class ASH_EXPORT TraySystemInfo : public SystemTrayItem, public ClockObserver {
SystemInfoDefaultView* default_view_; SystemInfoDefaultView* default_view_;
LoginStatus login_status_; LoginStatus login_status_;
#if defined(OS_CHROMEOS)
std::unique_ptr<SystemClockObserver> system_clock_observer_; std::unique_ptr<SystemClockObserver> system_clock_observer_;
#endif
DISALLOW_COPY_AND_ASSIGN(TraySystemInfo); DISALLOW_COPY_AND_ASSIGN(TraySystemInfo);
}; };
......
...@@ -6,6 +6,11 @@ ...@@ -6,6 +6,11 @@
#include "ash/common/material_design/material_design_controller.h" #include "ash/common/material_design/material_design_controller.h"
#include "ash/common/shelf/wm_shelf.h" #include "ash/common/shelf/wm_shelf.h"
#include "ash/common/system/chromeos/ime_menu/ime_menu_tray.h"
#include "ash/common/system/chromeos/palette/palette_tray.h"
#include "ash/common/system/chromeos/palette/palette_utils.h"
#include "ash/common/system/chromeos/session/logout_button_tray.h"
#include "ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h"
#include "ash/common/system/overview/overview_button_tray.h" #include "ash/common/system/overview/overview_button_tray.h"
#include "ash/common/system/status_area_widget_delegate.h" #include "ash/common/system/status_area_widget_delegate.h"
#include "ash/common/system/tray/system_tray.h" #include "ash/common/system/tray/system_tray.h"
...@@ -17,16 +22,8 @@ ...@@ -17,16 +22,8 @@
#include "ash/common/wm_window.h" #include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h" #include "ash/public/cpp/shell_window_ids.h"
#include "base/i18n/time_formatting.h" #include "base/i18n/time_formatting.h"
#include "ui/native_theme/native_theme_dark_aura.h"
#if defined(OS_CHROMEOS)
#include "ash/common/system/chromeos/ime_menu/ime_menu_tray.h"
#include "ash/common/system/chromeos/palette/palette_tray.h"
#include "ash/common/system/chromeos/palette/palette_utils.h"
#include "ash/common/system/chromeos/session/logout_button_tray.h"
#include "ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h"
#include "ui/display/display.h" #include "ui/display/display.h"
#endif #include "ui/native_theme/native_theme_dark_aura.h"
namespace ash { namespace ash {
...@@ -36,12 +33,10 @@ StatusAreaWidget::StatusAreaWidget(WmWindow* status_container, ...@@ -36,12 +33,10 @@ StatusAreaWidget::StatusAreaWidget(WmWindow* status_container,
overview_button_tray_(nullptr), overview_button_tray_(nullptr),
system_tray_(nullptr), system_tray_(nullptr),
web_notification_tray_(nullptr), web_notification_tray_(nullptr),
#if defined(OS_CHROMEOS)
logout_button_tray_(nullptr), logout_button_tray_(nullptr),
palette_tray_(nullptr), palette_tray_(nullptr),
virtual_keyboard_tray_(nullptr), virtual_keyboard_tray_(nullptr),
ime_menu_tray_(nullptr), ime_menu_tray_(nullptr),
#endif
login_status_(LoginStatus::NOT_LOGGED_IN), login_status_(LoginStatus::NOT_LOGGED_IN),
wm_shelf_(wm_shelf) { wm_shelf_(wm_shelf) {
views::Widget::InitParams params( views::Widget::InitParams params(
...@@ -63,25 +58,21 @@ void StatusAreaWidget::CreateTrayViews() { ...@@ -63,25 +58,21 @@ void StatusAreaWidget::CreateTrayViews() {
AddOverviewButtonTray(); AddOverviewButtonTray();
AddSystemTray(); AddSystemTray();
AddWebNotificationTray(); AddWebNotificationTray();
#if defined(OS_CHROMEOS)
AddPaletteTray(); AddPaletteTray();
AddVirtualKeyboardTray(); AddVirtualKeyboardTray();
AddImeMenuTray(); AddImeMenuTray();
AddLogoutButtonTray(); AddLogoutButtonTray();
#endif
SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate(); SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate();
DCHECK(delegate); DCHECK(delegate);
// Initialize after all trays have been created. // Initialize after all trays have been created.
system_tray_->InitializeTrayItems(delegate, web_notification_tray_); system_tray_->InitializeTrayItems(delegate, web_notification_tray_);
web_notification_tray_->Initialize(); web_notification_tray_->Initialize();
#if defined(OS_CHROMEOS)
logout_button_tray_->Initialize(); logout_button_tray_->Initialize();
if (palette_tray_) if (palette_tray_)
palette_tray_->Initialize(); palette_tray_->Initialize();
virtual_keyboard_tray_->Initialize(); virtual_keyboard_tray_->Initialize();
ime_menu_tray_->Initialize(); ime_menu_tray_->Initialize();
#endif
overview_button_tray_->Initialize(); overview_button_tray_->Initialize();
SetShelfAlignment(system_tray_->shelf_alignment()); SetShelfAlignment(system_tray_->shelf_alignment());
UpdateAfterLoginStatusChange(delegate->GetUserLoginStatus()); UpdateAfterLoginStatusChange(delegate->GetUserLoginStatus());
...@@ -97,14 +88,12 @@ void StatusAreaWidget::Shutdown() { ...@@ -97,14 +88,12 @@ void StatusAreaWidget::Shutdown() {
// Must be destroyed after |web_notification_tray_|. // Must be destroyed after |web_notification_tray_|.
delete system_tray_; delete system_tray_;
system_tray_ = nullptr; system_tray_ = nullptr;
#if defined(OS_CHROMEOS)
delete ime_menu_tray_; delete ime_menu_tray_;
ime_menu_tray_ = nullptr; ime_menu_tray_ = nullptr;
delete virtual_keyboard_tray_; delete virtual_keyboard_tray_;
virtual_keyboard_tray_ = nullptr; virtual_keyboard_tray_ = nullptr;
delete logout_button_tray_; delete logout_button_tray_;
logout_button_tray_ = nullptr; logout_button_tray_ = nullptr;
#endif
delete overview_button_tray_; delete overview_button_tray_;
overview_button_tray_ = nullptr; overview_button_tray_ = nullptr;
} }
...@@ -115,7 +104,6 @@ void StatusAreaWidget::SetShelfAlignment(ShelfAlignment alignment) { ...@@ -115,7 +104,6 @@ void StatusAreaWidget::SetShelfAlignment(ShelfAlignment alignment) {
system_tray_->SetShelfAlignment(alignment); system_tray_->SetShelfAlignment(alignment);
if (web_notification_tray_) if (web_notification_tray_)
web_notification_tray_->SetShelfAlignment(alignment); web_notification_tray_->SetShelfAlignment(alignment);
#if defined(OS_CHROMEOS)
if (logout_button_tray_) if (logout_button_tray_)
logout_button_tray_->SetShelfAlignment(alignment); logout_button_tray_->SetShelfAlignment(alignment);
if (virtual_keyboard_tray_) if (virtual_keyboard_tray_)
...@@ -124,7 +112,6 @@ void StatusAreaWidget::SetShelfAlignment(ShelfAlignment alignment) { ...@@ -124,7 +112,6 @@ void StatusAreaWidget::SetShelfAlignment(ShelfAlignment alignment) {
ime_menu_tray_->SetShelfAlignment(alignment); ime_menu_tray_->SetShelfAlignment(alignment);
if (palette_tray_) if (palette_tray_)
palette_tray_->SetShelfAlignment(alignment); palette_tray_->SetShelfAlignment(alignment);
#endif
if (overview_button_tray_) if (overview_button_tray_)
overview_button_tray_->SetShelfAlignment(alignment); overview_button_tray_->SetShelfAlignment(alignment);
status_area_widget_delegate_->UpdateLayout(); status_area_widget_delegate_->UpdateLayout();
...@@ -138,10 +125,8 @@ void StatusAreaWidget::UpdateAfterLoginStatusChange(LoginStatus login_status) { ...@@ -138,10 +125,8 @@ void StatusAreaWidget::UpdateAfterLoginStatusChange(LoginStatus login_status) {
system_tray_->UpdateAfterLoginStatusChange(login_status); system_tray_->UpdateAfterLoginStatusChange(login_status);
if (web_notification_tray_) if (web_notification_tray_)
web_notification_tray_->UpdateAfterLoginStatusChange(login_status); web_notification_tray_->UpdateAfterLoginStatusChange(login_status);
#if defined(OS_CHROMEOS)
if (logout_button_tray_) if (logout_button_tray_)
logout_button_tray_->UpdateAfterLoginStatusChange(login_status); logout_button_tray_->UpdateAfterLoginStatusChange(login_status);
#endif
if (overview_button_tray_) if (overview_button_tray_)
overview_button_tray_->UpdateAfterLoginStatusChange(login_status); overview_button_tray_->UpdateAfterLoginStatusChange(login_status);
} }
...@@ -152,13 +137,11 @@ bool StatusAreaWidget::ShouldShowShelf() const { ...@@ -152,13 +137,11 @@ bool StatusAreaWidget::ShouldShowShelf() const {
web_notification_tray_->ShouldBlockShelfAutoHide())) web_notification_tray_->ShouldBlockShelfAutoHide()))
return true; return true;
#if defined(OS_CHROMEOS)
if (palette_tray_ && palette_tray_->ShouldBlockShelfAutoHide()) if (palette_tray_ && palette_tray_->ShouldBlockShelfAutoHide())
return true; return true;
if (ime_menu_tray_ && ime_menu_tray_->ShouldBlockShelfAutoHide()) if (ime_menu_tray_ && ime_menu_tray_->ShouldBlockShelfAutoHide())
return true; return true;
#endif
if (!wm_shelf_->IsVisible()) if (!wm_shelf_->IsVisible())
return false; return false;
...@@ -180,13 +163,11 @@ void StatusAreaWidget::SchedulePaint() { ...@@ -180,13 +163,11 @@ void StatusAreaWidget::SchedulePaint() {
status_area_widget_delegate_->SchedulePaint(); status_area_widget_delegate_->SchedulePaint();
web_notification_tray_->SchedulePaint(); web_notification_tray_->SchedulePaint();
system_tray_->SchedulePaint(); system_tray_->SchedulePaint();
#if defined(OS_CHROMEOS)
virtual_keyboard_tray_->SchedulePaint(); virtual_keyboard_tray_->SchedulePaint();
logout_button_tray_->SchedulePaint(); logout_button_tray_->SchedulePaint();
ime_menu_tray_->SchedulePaint(); ime_menu_tray_->SchedulePaint();
if (palette_tray_) if (palette_tray_)
palette_tray_->SchedulePaint(); palette_tray_->SchedulePaint();
#endif
overview_button_tray_->SchedulePaint(); overview_button_tray_->SchedulePaint();
} }
...@@ -205,13 +186,11 @@ void StatusAreaWidget::OnNativeWidgetActivationChanged(bool active) { ...@@ -205,13 +186,11 @@ void StatusAreaWidget::OnNativeWidgetActivationChanged(bool active) {
void StatusAreaWidget::UpdateShelfItemBackground(int alpha) { void StatusAreaWidget::UpdateShelfItemBackground(int alpha) {
web_notification_tray_->UpdateShelfItemBackground(alpha); web_notification_tray_->UpdateShelfItemBackground(alpha);
system_tray_->UpdateShelfItemBackground(alpha); system_tray_->UpdateShelfItemBackground(alpha);
#if defined(OS_CHROMEOS)
virtual_keyboard_tray_->UpdateShelfItemBackground(alpha); virtual_keyboard_tray_->UpdateShelfItemBackground(alpha);
logout_button_tray_->UpdateShelfItemBackground(alpha); logout_button_tray_->UpdateShelfItemBackground(alpha);
ime_menu_tray_->UpdateShelfItemBackground(alpha); ime_menu_tray_->UpdateShelfItemBackground(alpha);
if (palette_tray_) if (palette_tray_)
palette_tray_->UpdateShelfItemBackground(alpha); palette_tray_->UpdateShelfItemBackground(alpha);
#endif
overview_button_tray_->UpdateShelfItemBackground(alpha); overview_button_tray_->UpdateShelfItemBackground(alpha);
} }
...@@ -227,7 +206,6 @@ void StatusAreaWidget::AddWebNotificationTray() { ...@@ -227,7 +206,6 @@ void StatusAreaWidget::AddWebNotificationTray() {
status_area_widget_delegate_->AddTray(web_notification_tray_); status_area_widget_delegate_->AddTray(web_notification_tray_);
} }
#if defined(OS_CHROMEOS)
void StatusAreaWidget::AddLogoutButtonTray() { void StatusAreaWidget::AddLogoutButtonTray() {
logout_button_tray_ = new LogoutButtonTray(wm_shelf_); logout_button_tray_ = new LogoutButtonTray(wm_shelf_);
status_area_widget_delegate_->AddTray(logout_button_tray_); status_area_widget_delegate_->AddTray(logout_button_tray_);
...@@ -258,7 +236,6 @@ void StatusAreaWidget::AddImeMenuTray() { ...@@ -258,7 +236,6 @@ void StatusAreaWidget::AddImeMenuTray() {
ime_menu_tray_ = new ImeMenuTray(wm_shelf_); ime_menu_tray_ = new ImeMenuTray(wm_shelf_);
status_area_widget_delegate_->AddTray(ime_menu_tray_); status_area_widget_delegate_->AddTray(ime_menu_tray_);
} }
#endif
void StatusAreaWidget::AddOverviewButtonTray() { void StatusAreaWidget::AddOverviewButtonTray() {
overview_button_tray_ = new OverviewButtonTray(wm_shelf_); overview_button_tray_ = new OverviewButtonTray(wm_shelf_);
......
...@@ -13,18 +13,16 @@ ...@@ -13,18 +13,16 @@
#include "ui/views/widget/widget.h" #include "ui/views/widget/widget.h"
namespace ash { namespace ash {
class ImeMenuTray;
class LogoutButtonTray;
class OverviewButtonTray; class OverviewButtonTray;
class PaletteTray;
class StatusAreaWidgetDelegate; class StatusAreaWidgetDelegate;
class SystemTray; class SystemTray;
class VirtualKeyboardTray;
class WebNotificationTray; class WebNotificationTray;
class WmShelf; class WmShelf;
class WmWindow; class WmWindow;
#if defined(OS_CHROMEOS)
class ImeMenuTray;
class LogoutButtonTray;
class PaletteTray;
class VirtualKeyboardTray;
#endif
class ASH_EXPORT StatusAreaWidget : public views::Widget, class ASH_EXPORT StatusAreaWidget : public views::Widget,
public ShelfBackgroundAnimatorObserver { public ShelfBackgroundAnimatorObserver {
...@@ -56,11 +54,9 @@ class ASH_EXPORT StatusAreaWidget : public views::Widget, ...@@ -56,11 +54,9 @@ class ASH_EXPORT StatusAreaWidget : public views::Widget,
} }
OverviewButtonTray* overview_button_tray() { return overview_button_tray_; } OverviewButtonTray* overview_button_tray() { return overview_button_tray_; }
#if defined(OS_CHROMEOS)
PaletteTray* palette_tray() { return palette_tray_; } PaletteTray* palette_tray() { return palette_tray_; }
ImeMenuTray* ime_menu_tray() { return ime_menu_tray_; } ImeMenuTray* ime_menu_tray() { return ime_menu_tray_; }
#endif
WmShelf* wm_shelf() { return wm_shelf_; } WmShelf* wm_shelf() { return wm_shelf_; }
...@@ -88,12 +84,10 @@ class ASH_EXPORT StatusAreaWidget : public views::Widget, ...@@ -88,12 +84,10 @@ class ASH_EXPORT StatusAreaWidget : public views::Widget,
private: private:
void AddSystemTray(); void AddSystemTray();
void AddWebNotificationTray(); void AddWebNotificationTray();
#if defined(OS_CHROMEOS)
void AddLogoutButtonTray(); void AddLogoutButtonTray();
void AddPaletteTray(); void AddPaletteTray();
void AddVirtualKeyboardTray(); void AddVirtualKeyboardTray();
void AddImeMenuTray(); void AddImeMenuTray();
#endif
void AddOverviewButtonTray(); void AddOverviewButtonTray();
// Weak pointers to View classes that are parented to StatusAreaWidget: // Weak pointers to View classes that are parented to StatusAreaWidget:
...@@ -101,12 +95,10 @@ class ASH_EXPORT StatusAreaWidget : public views::Widget, ...@@ -101,12 +95,10 @@ class ASH_EXPORT StatusAreaWidget : public views::Widget,
OverviewButtonTray* overview_button_tray_; OverviewButtonTray* overview_button_tray_;
SystemTray* system_tray_; SystemTray* system_tray_;
WebNotificationTray* web_notification_tray_; WebNotificationTray* web_notification_tray_;
#if defined(OS_CHROMEOS)
LogoutButtonTray* logout_button_tray_; LogoutButtonTray* logout_button_tray_;
PaletteTray* palette_tray_; PaletteTray* palette_tray_;
VirtualKeyboardTray* virtual_keyboard_tray_; VirtualKeyboardTray* virtual_keyboard_tray_;
ImeMenuTray* ime_menu_tray_; ImeMenuTray* ime_menu_tray_;
#endif
LoginStatus login_status_; LoginStatus login_status_;
WmShelf* wm_shelf_; WmShelf* wm_shelf_;
......
...@@ -20,9 +20,7 @@ namespace { ...@@ -20,9 +20,7 @@ namespace {
const char* kAlwaysShownSystemNotifierIds[] = { const char* kAlwaysShownSystemNotifierIds[] = {
kNotifierAccessibility, kNotifierDeprecatedAccelerator, kNotifierBattery, kNotifierAccessibility, kNotifierDeprecatedAccelerator, kNotifierBattery,
kNotifierDisplay, kNotifierDisplayError, kNotifierDisplay, kNotifierDisplayError,
#if defined(OS_CHROMEOS)
kNotifierNetworkError, kNotifierNetworkError,
#endif
kNotifierPower, kNotifierPower,
// Note: Order doesn't matter here, so keep this in alphabetic order, don't // Note: Order doesn't matter here, so keep this in alphabetic order, don't
// just add your stuff at the end! // just add your stuff at the end!
...@@ -31,14 +29,8 @@ const char* kAlwaysShownSystemNotifierIds[] = { ...@@ -31,14 +29,8 @@ const char* kAlwaysShownSystemNotifierIds[] = {
// |kAshSystemNotifiers| is the list of normal system notification sources for // |kAshSystemNotifiers| is the list of normal system notification sources for
// ash events. These notifications can be hidden in some context. // ash events. These notifications can be hidden in some context.
const char* kAshSystemNotifiers[] = { const char* kAshSystemNotifiers[] = {
kNotifierBluetooth, kNotifierDisplayResolutionChange, kNotifierBluetooth, kNotifierDisplayResolutionChange, kNotifierDisk,
#if defined(OS_CHROMEOS) kNotifierLocale, kNotifierMultiProfileFirstRun, kNotifierNetwork,
kNotifierDisk,
#endif
kNotifierLocale, kNotifierMultiProfileFirstRun,
#if defined(OS_CHROMEOS)
kNotifierNetwork,
#endif
kNotifierNetworkPortalDetector, kNotifierScreenshot, kNotifierScreenCapture, kNotifierNetworkPortalDetector, kNotifierScreenshot, kNotifierScreenCapture,
kNotifierScreenShare, kNotifierSessionLengthTimeout, kNotifierScreenShare, kNotifierSessionLengthTimeout,
kNotifierSupervisedUser, kNotifierWebUsb, kNotifierSupervisedUser, kNotifierWebUsb,
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#include "ash/common/system/tray/tray_popup_utils.h" #include "ash/common/system/tray/tray_popup_utils.h"
#include "ash/common/wm_shell.h" #include "ash/common/wm_shell.h"
#include "ash/resources/vector_icons/vector_icons.h" #include "ash/resources/vector_icons/vector_icons.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/session_manager_client.h"
#include "grit/ash_strings.h" #include "grit/ash_strings.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/insets.h"
...@@ -24,11 +26,6 @@ ...@@ -24,11 +26,6 @@
#include "ui/views/controls/separator.h" #include "ui/views/controls/separator.h"
#include "ui/views/layout/box_layout.h" #include "ui/views/layout/box_layout.h"
#if defined(OS_CHROMEOS)
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/session_manager_client.h"
#endif
namespace { namespace {
// The ISO-639 code for the Hebrew locale. The help icon asset is a '?' which is // The ISO-639 code for the Hebrew locale. The help icon asset is a '?' which is
...@@ -87,7 +84,6 @@ void TilesDefaultView::Init() { ...@@ -87,7 +84,6 @@ void TilesDefaultView::Init() {
AddChildView(help_button_); AddChildView(help_button_);
AddChildView(TrayPopupUtils::CreateVerticalSeparator()); AddChildView(TrayPopupUtils::CreateVerticalSeparator());
#if !defined(OS_WIN)
lock_button_ = lock_button_ =
new SystemMenuButton(this, TrayPopupInkDropStyle::HOST_CENTERED, new SystemMenuButton(this, TrayPopupInkDropStyle::HOST_CENTERED,
kSystemMenuLockIcon, IDS_ASH_STATUS_TRAY_LOCK); kSystemMenuLockIcon, IDS_ASH_STATUS_TRAY_LOCK);
...@@ -106,7 +102,6 @@ void TilesDefaultView::Init() { ...@@ -106,7 +102,6 @@ void TilesDefaultView::Init() {
bool reboot = WmShell::Get()->shutdown_controller()->reboot_on_shutdown(); bool reboot = WmShell::Get()->shutdown_controller()->reboot_on_shutdown();
power_button_->SetTooltipText(l10n_util::GetStringUTF16( power_button_->SetTooltipText(l10n_util::GetStringUTF16(
reboot ? IDS_ASH_STATUS_TRAY_REBOOT : IDS_ASH_STATUS_TRAY_SHUTDOWN)); reboot ? IDS_ASH_STATUS_TRAY_REBOOT : IDS_ASH_STATUS_TRAY_SHUTDOWN));
#endif // !defined(OS_WIN)
} }
void TilesDefaultView::ButtonPressed(views::Button* sender, void TilesDefaultView::ButtonPressed(views::Button* sender,
...@@ -121,11 +116,9 @@ void TilesDefaultView::ButtonPressed(views::Button* sender, ...@@ -121,11 +116,9 @@ void TilesDefaultView::ButtonPressed(views::Button* sender,
shell->system_tray_controller()->ShowHelp(); shell->system_tray_controller()->ShowHelp();
} else if (sender == lock_button_) { } else if (sender == lock_button_) {
shell->RecordUserMetricsAction(UMA_TRAY_LOCK_SCREEN); shell->RecordUserMetricsAction(UMA_TRAY_LOCK_SCREEN);
#if defined(OS_CHROMEOS)
chromeos::DBusThreadManager::Get() chromeos::DBusThreadManager::Get()
->GetSessionManagerClient() ->GetSessionManagerClient()
->RequestLockScreen(); ->RequestLockScreen();
#endif
} else if (sender == power_button_) { } else if (sender == power_button_) {
shell->RecordUserMetricsAction(UMA_TRAY_SHUT_DOWN); shell->RecordUserMetricsAction(UMA_TRAY_SHUT_DOWN);
shell->RequestShutdown(); shell->RequestShutdown();
......
...@@ -58,10 +58,8 @@ TEST_F(TrayTilesTest, ButtonStatesWithAddingUser) { ...@@ -58,10 +58,8 @@ TEST_F(TrayTilesTest, ButtonStatesWithAddingUser) {
tray_tiles()->CreateDefaultViewForTesting(LoginStatus::USER)); tray_tiles()->CreateDefaultViewForTesting(LoginStatus::USER));
EXPECT_EQ(GetSettingsButton()->state(), views::Button::STATE_DISABLED); EXPECT_EQ(GetSettingsButton()->state(), views::Button::STATE_DISABLED);
EXPECT_EQ(GetHelpButton()->state(), views::Button::STATE_DISABLED); EXPECT_EQ(GetHelpButton()->state(), views::Button::STATE_DISABLED);
#if !defined(OS_WIN)
EXPECT_EQ(GetLockButton()->state(), views::Button::STATE_DISABLED); EXPECT_EQ(GetLockButton()->state(), views::Button::STATE_DISABLED);
EXPECT_EQ(GetPowerButton()->state(), views::Button::STATE_NORMAL); EXPECT_EQ(GetPowerButton()->state(), views::Button::STATE_NORMAL);
#endif // !defined(OS_WIN)
} }
TEST_F(TrayTilesTest, ButtonStatesWithLoginStatusNotLoggedIn) { TEST_F(TrayTilesTest, ButtonStatesWithLoginStatusNotLoggedIn) {
...@@ -69,10 +67,8 @@ TEST_F(TrayTilesTest, ButtonStatesWithLoginStatusNotLoggedIn) { ...@@ -69,10 +67,8 @@ TEST_F(TrayTilesTest, ButtonStatesWithLoginStatusNotLoggedIn) {
tray_tiles()->CreateDefaultViewForTesting(LoginStatus::NOT_LOGGED_IN)); tray_tiles()->CreateDefaultViewForTesting(LoginStatus::NOT_LOGGED_IN));
EXPECT_EQ(GetSettingsButton()->state(), views::Button::STATE_DISABLED); EXPECT_EQ(GetSettingsButton()->state(), views::Button::STATE_DISABLED);
EXPECT_EQ(GetHelpButton()->state(), views::Button::STATE_DISABLED); EXPECT_EQ(GetHelpButton()->state(), views::Button::STATE_DISABLED);
#if !defined(OS_WIN)
EXPECT_EQ(GetLockButton()->state(), views::Button::STATE_DISABLED); EXPECT_EQ(GetLockButton()->state(), views::Button::STATE_DISABLED);
EXPECT_EQ(GetPowerButton()->state(), views::Button::STATE_NORMAL); EXPECT_EQ(GetPowerButton()->state(), views::Button::STATE_NORMAL);
#endif // !defined(OS_WIN)
} }
TEST_F(TrayTilesTest, ButtonStatesWithLoginStatusLocked) { TEST_F(TrayTilesTest, ButtonStatesWithLoginStatusLocked) {
...@@ -80,10 +76,8 @@ TEST_F(TrayTilesTest, ButtonStatesWithLoginStatusLocked) { ...@@ -80,10 +76,8 @@ TEST_F(TrayTilesTest, ButtonStatesWithLoginStatusLocked) {
tray_tiles()->CreateDefaultViewForTesting(LoginStatus::LOCKED)); tray_tiles()->CreateDefaultViewForTesting(LoginStatus::LOCKED));
EXPECT_EQ(GetSettingsButton()->state(), views::Button::STATE_DISABLED); EXPECT_EQ(GetSettingsButton()->state(), views::Button::STATE_DISABLED);
EXPECT_EQ(GetHelpButton()->state(), views::Button::STATE_DISABLED); EXPECT_EQ(GetHelpButton()->state(), views::Button::STATE_DISABLED);
#if !defined(OS_WIN)
EXPECT_EQ(GetLockButton()->state(), views::Button::STATE_DISABLED); EXPECT_EQ(GetLockButton()->state(), views::Button::STATE_DISABLED);
EXPECT_EQ(GetPowerButton()->state(), views::Button::STATE_NORMAL); EXPECT_EQ(GetPowerButton()->state(), views::Button::STATE_NORMAL);
#endif // !defined(OS_WIN)
} }
TEST_F(TrayTilesTest, ButtonStatesWithLoginStatusUser) { TEST_F(TrayTilesTest, ButtonStatesWithLoginStatusUser) {
...@@ -91,10 +85,8 @@ TEST_F(TrayTilesTest, ButtonStatesWithLoginStatusUser) { ...@@ -91,10 +85,8 @@ TEST_F(TrayTilesTest, ButtonStatesWithLoginStatusUser) {
tray_tiles()->CreateDefaultViewForTesting(LoginStatus::USER)); tray_tiles()->CreateDefaultViewForTesting(LoginStatus::USER));
EXPECT_EQ(GetSettingsButton()->state(), views::Button::STATE_NORMAL); EXPECT_EQ(GetSettingsButton()->state(), views::Button::STATE_NORMAL);
EXPECT_EQ(GetHelpButton()->state(), views::Button::STATE_NORMAL); EXPECT_EQ(GetHelpButton()->state(), views::Button::STATE_NORMAL);
#if !defined(OS_WIN)
EXPECT_EQ(GetLockButton()->state(), views::Button::STATE_NORMAL); EXPECT_EQ(GetLockButton()->state(), views::Button::STATE_NORMAL);
EXPECT_EQ(GetPowerButton()->state(), views::Button::STATE_NORMAL); EXPECT_EQ(GetPowerButton()->state(), views::Button::STATE_NORMAL);
#endif // !defined(OS_WIN)
} }
} // namespace ash } // namespace ash
...@@ -193,7 +193,6 @@ TEST_F(TrayUserTest, AccessibleLabelContainsMultiUserInfo) { ...@@ -193,7 +193,6 @@ TEST_F(TrayUserTest, AccessibleLabelContainsMultiUserInfo) {
EXPECT_EQ(ui::AX_ROLE_BUTTON, node_data.role); EXPECT_EQ(ui::AX_ROLE_BUTTON, node_data.role);
} }
#if defined(OS_CHROMEOS)
// Make sure that in multi user mode the user panel can be activated and there // Make sure that in multi user mode the user panel can be activated and there
// will be one panel for each user plus one additional separator at the end. // will be one panel for each user plus one additional separator at the end.
// Note: the mouse watcher (for automatic closing upon leave) cannot be tested // Note: the mouse watcher (for automatic closing upon leave) cannot be tested
...@@ -279,6 +278,4 @@ TEST_F(TrayUserTest, MultiUserModeButtonClicks) { ...@@ -279,6 +278,4 @@ TEST_F(TrayUserTest, MultiUserModeButtonClicks) {
tray()->CloseSystemBubble(); tray()->CloseSystemBubble();
} }
#endif
} // namespace ash } // namespace ash
...@@ -45,20 +45,16 @@ ...@@ -45,20 +45,16 @@
#include "ui/views/controls/menu/menu_runner.h" #include "ui/views/controls/menu/menu_runner.h"
#include "ui/views/layout/fill_layout.h" #include "ui/views/layout/fill_layout.h"
#if defined(OS_CHROMEOS)
namespace message_center { namespace message_center {
MessageCenterTrayDelegate* CreateMessageCenterTray() { MessageCenterTrayDelegate* CreateMessageCenterTray() {
// On Windows+Ash the Tray will not be hosted in ash::Shell. // On non-CrOS, the Tray will not be hosted in ash::Shell.
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
} // namespace message_center } // namespace message_center
#endif // defined(OS_CHROMEOS)
namespace ash { namespace ash {
namespace { namespace {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment