| Index: ash/system/tray/system_tray.cc
|
| diff --git a/ash/system/tray/system_tray.cc b/ash/system/tray/system_tray.cc
|
| index 5c1189d259fda1bd6ceb9c5c4fef5b5949b09d51..18cb4512fbe0769d8ffe9346cac08b56a5dd5e79 100644
|
| --- a/ash/system/tray/system_tray.cc
|
| +++ b/ash/system/tray/system_tray.cc
|
| @@ -73,18 +73,14 @@ namespace ash {
|
| // The minimum width of the system tray menu width.
|
| const int kMinimumSystemTrayMenuWidth = 300;
|
|
|
| -namespace internal {
|
| -
|
| // Class to initialize and manage the SystemTrayBubble and TrayBubbleWrapper
|
| // instances for a bubble.
|
|
|
| class SystemBubbleWrapper {
|
| public:
|
| // Takes ownership of |bubble|.
|
| - explicit SystemBubbleWrapper(internal::SystemTrayBubble* bubble)
|
| - : bubble_(bubble),
|
| - is_persistent_(false) {
|
| - }
|
| + explicit SystemBubbleWrapper(SystemTrayBubble* bubble)
|
| + : bubble_(bubble), is_persistent_(false) {}
|
|
|
| // Initializes the bubble view and creates |bubble_wrapper_|.
|
| void InitView(TrayBackgroundView* tray,
|
| @@ -95,8 +91,7 @@ class SystemBubbleWrapper {
|
| user::LoginStatus login_status =
|
| Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus();
|
| bubble_->InitView(anchor, login_status, init_params);
|
| - bubble_wrapper_.reset(
|
| - new internal::TrayBubbleWrapper(tray, bubble_->bubble_view()));
|
| + bubble_wrapper_.reset(new TrayBubbleWrapper(tray, bubble_->bubble_view()));
|
| if (ash::switches::UseAlternateShelfLayout()) {
|
| // The system bubble should not have an arrow.
|
| bubble_->bubble_view()->SetArrowPaintType(
|
| @@ -120,21 +115,18 @@ class SystemBubbleWrapper {
|
| bool is_persistent() const { return is_persistent_; }
|
|
|
| private:
|
| - scoped_ptr<internal::SystemTrayBubble> bubble_;
|
| - scoped_ptr<internal::TrayBubbleWrapper> bubble_wrapper_;
|
| + scoped_ptr<SystemTrayBubble> bubble_;
|
| + scoped_ptr<TrayBubbleWrapper> bubble_wrapper_;
|
| bool is_persistent_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(SystemBubbleWrapper);
|
| };
|
|
|
| -} // namespace internal
|
|
|
| // SystemTray
|
|
|
| -using internal::SystemTrayBubble;
|
| -
|
| -SystemTray::SystemTray(internal::StatusAreaWidget* status_area_widget)
|
| - : internal::TrayBackgroundView(status_area_widget),
|
| +SystemTray::SystemTray(StatusAreaWidget* status_area_widget)
|
| + : TrayBackgroundView(status_area_widget),
|
| items_(),
|
| default_bubble_height_(0),
|
| hide_notifications_(false),
|
| @@ -156,13 +148,13 @@ SystemTray::~SystemTray() {
|
| }
|
|
|
| void SystemTray::InitializeTrayItems(SystemTrayDelegate* delegate) {
|
| - internal::TrayBackgroundView::Initialize();
|
| + TrayBackgroundView::Initialize();
|
| CreateItems(delegate);
|
| }
|
|
|
| void SystemTray::CreateItems(SystemTrayDelegate* delegate) {
|
| #if defined(OS_CHROMEOS)
|
| - AddTrayItem(new internal::TraySessionLengthLimit(this));
|
| + AddTrayItem(new TraySessionLengthLimit(this));
|
| #endif
|
| #if !defined(OS_WIN)
|
| // Create user items for each possible user.
|
| @@ -170,52 +162,51 @@ void SystemTray::CreateItems(SystemTrayDelegate* delegate) {
|
| int maximum_user_profiles =
|
| shell->session_state_delegate()->GetMaximumNumberOfLoggedInUsers();
|
| for (int i = 0; i < maximum_user_profiles; i++)
|
| - AddTrayItem(new internal::TrayUser(this, i));
|
| + AddTrayItem(new TrayUser(this, i));
|
|
|
| if (maximum_user_profiles > 1) {
|
| // Add a special double line separator between users and the rest of the
|
| // menu if more then one user is logged in.
|
| - AddTrayItem(new internal::TrayUserSeparator(this));
|
| + AddTrayItem(new TrayUserSeparator(this));
|
| }
|
| #endif
|
|
|
| - tray_accessibility_ = new internal::TrayAccessibility(this);
|
| - tray_date_ = new internal::TrayDate(this);
|
| + tray_accessibility_ = new TrayAccessibility(this);
|
| + tray_date_ = new TrayDate(this);
|
|
|
| #if defined(OS_CHROMEOS)
|
| - AddTrayItem(new internal::TrayEnterprise(this));
|
| - AddTrayItem(new internal::TrayLocallyManagedUser(this));
|
| - AddTrayItem(new internal::TrayIME(this));
|
| + AddTrayItem(new TrayEnterprise(this));
|
| + AddTrayItem(new TrayLocallyManagedUser(this));
|
| + AddTrayItem(new TrayIME(this));
|
| AddTrayItem(tray_accessibility_);
|
| - AddTrayItem(new internal::TrayTracing(this));
|
| - AddTrayItem(
|
| - new internal::TrayPower(this, message_center::MessageCenter::Get()));
|
| - AddTrayItem(new internal::TrayNetwork(this));
|
| - AddTrayItem(new internal::TrayVPN(this));
|
| - AddTrayItem(new internal::TraySms(this));
|
| - AddTrayItem(new internal::TrayBluetooth(this));
|
| - AddTrayItem(new internal::TrayDrive(this));
|
| - AddTrayItem(new internal::TrayDisplay(this));
|
| - AddTrayItem(new internal::ScreenCaptureTrayItem(this));
|
| - AddTrayItem(new internal::ScreenShareTrayItem(this));
|
| - AddTrayItem(new internal::TrayAudioChromeOs(this));
|
| - AddTrayItem(new internal::TrayBrightness(this));
|
| - AddTrayItem(new internal::TrayCapsLock(this));
|
| - AddTrayItem(new internal::TraySettings(this));
|
| - AddTrayItem(new internal::TrayUpdate(this));
|
| + AddTrayItem(new TrayTracing(this));
|
| + AddTrayItem(new TrayPower(this, message_center::MessageCenter::Get()));
|
| + AddTrayItem(new TrayNetwork(this));
|
| + AddTrayItem(new TrayVPN(this));
|
| + AddTrayItem(new TraySms(this));
|
| + AddTrayItem(new TrayBluetooth(this));
|
| + AddTrayItem(new TrayDrive(this));
|
| + AddTrayItem(new TrayDisplay(this));
|
| + AddTrayItem(new ScreenCaptureTrayItem(this));
|
| + AddTrayItem(new ScreenShareTrayItem(this));
|
| + AddTrayItem(new TrayAudioChromeOs(this));
|
| + AddTrayItem(new TrayBrightness(this));
|
| + AddTrayItem(new TrayCapsLock(this));
|
| + AddTrayItem(new TraySettings(this));
|
| + AddTrayItem(new TrayUpdate(this));
|
| AddTrayItem(tray_date_);
|
| #elif defined(OS_WIN)
|
| AddTrayItem(tray_accessibility_);
|
| if (media::CoreAudioUtil::IsSupported())
|
| - AddTrayItem(new internal::TrayAudioWin(this));
|
| - AddTrayItem(new internal::TrayUpdate(this));
|
| + AddTrayItem(new TrayAudioWin(this));
|
| + AddTrayItem(new TrayUpdate(this));
|
| AddTrayItem(tray_date_);
|
| #elif defined(OS_LINUX)
|
| - AddTrayItem(new internal::TrayIME(this));
|
| + AddTrayItem(new TrayIME(this));
|
| AddTrayItem(tray_accessibility_);
|
| - AddTrayItem(new internal::TrayBluetooth(this));
|
| - AddTrayItem(new internal::TrayDrive(this));
|
| - AddTrayItem(new internal::TrayUpdate(this));
|
| + AddTrayItem(new TrayBluetooth(this));
|
| + AddTrayItem(new TrayDrive(this));
|
| + AddTrayItem(new TrayUpdate(this));
|
| AddTrayItem(tray_date_);
|
| #endif
|
|
|
| @@ -348,7 +339,7 @@ bool SystemTray::HasNotificationBubble() const {
|
| return notification_bubble_.get() != NULL;
|
| }
|
|
|
| -internal::SystemTrayBubble* SystemTray::GetSystemBubble() {
|
| +SystemTrayBubble* SystemTray::GetSystemBubble() {
|
| if (!system_bubble_)
|
| return NULL;
|
| return system_bubble_->bubble();
|
| @@ -501,7 +492,7 @@ void SystemTray::ShowItems(const std::vector<SystemTrayItem*>& items,
|
| if (items.size() == 1 && items[0]->ShouldHideArrow())
|
| init_params.arrow_paint_type = views::BubbleBorder::PAINT_TRANSPARENT;
|
| SystemTrayBubble* bubble = new SystemTrayBubble(this, items, bubble_type);
|
| - system_bubble_.reset(new internal::SystemBubbleWrapper(bubble));
|
| + system_bubble_.reset(new SystemBubbleWrapper(bubble));
|
| system_bubble_->InitView(this, tray_container(), &init_params, persistent);
|
| }
|
| // Save height of default view for creating detailed views directly.
|
| @@ -558,8 +549,7 @@ void SystemTray::UpdateNotificationBubble() {
|
| ash::switches::UseAlternateShelfLayout();
|
| init_params.arrow_color = kBackgroundColor;
|
| init_params.arrow_offset = GetTrayXOffset(notification_items_[0]);
|
| - notification_bubble_.reset(
|
| - new internal::SystemBubbleWrapper(notification_bubble));
|
| + notification_bubble_.reset(new SystemBubbleWrapper(notification_bubble));
|
| notification_bubble_->InitView(this, anchor, &init_params, false);
|
|
|
| if (notification_bubble->bubble_view()->child_count() == 0) {
|
| @@ -598,7 +588,7 @@ void SystemTray::UpdateWebNotifications() {
|
| void SystemTray::SetShelfAlignment(ShelfAlignment alignment) {
|
| if (alignment == shelf_alignment())
|
| return;
|
| - internal::TrayBackgroundView::SetShelfAlignment(alignment);
|
| + TrayBackgroundView::SetShelfAlignment(alignment);
|
| UpdateAfterShelfAlignmentChange(alignment);
|
| // Destroy any existing bubble so that it is rebuilt correctly.
|
| CloseSystemBubbleAndDeactivateSystemTray();
|
| @@ -686,9 +676,7 @@ views::View* SystemTray::GetTrayItemViewForTest(SystemTrayItem* item) {
|
| return it == tray_item_map_.end() ? NULL : it->second;
|
| }
|
|
|
| -internal::TrayDate* SystemTray::GetTrayDateForTesting() const {
|
| - return tray_date_;
|
| -}
|
| +TrayDate* SystemTray::GetTrayDateForTesting() const { return tray_date_; }
|
|
|
| bool SystemTray::PerformAction(const ui::Event& event) {
|
| // If we're already showing the default view, hide it; otherwise, show it
|
|
|