| OLD | NEW |
| 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/web_notification/web_notification_tray.h" | 5 #include "ash/system/web_notification/web_notification_tray.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
| 10 #include "ash/shelf/shelf_layout_manager_observer.h" | 10 #include "ash/shelf/shelf_layout_manager_observer.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "ash/system/web_notification/ash_popup_alignment_delegate.h" | 21 #include "ash/system/web_notification/ash_popup_alignment_delegate.h" |
| 22 #include "base/auto_reset.h" | 22 #include "base/auto_reset.h" |
| 23 #include "base/i18n/number_formatting.h" | 23 #include "base/i18n/number_formatting.h" |
| 24 #include "base/i18n/rtl.h" | 24 #include "base/i18n/rtl.h" |
| 25 #include "base/strings/utf_string_conversions.h" | 25 #include "base/strings/utf_string_conversions.h" |
| 26 #include "base/thread_task_runner_handle.h" | 26 #include "base/thread_task_runner_handle.h" |
| 27 #include "grit/ash_strings.h" | 27 #include "grit/ash_strings.h" |
| 28 #include "ui/aura/window.h" | 28 #include "ui/aura/window.h" |
| 29 #include "ui/aura/window_event_dispatcher.h" | 29 #include "ui/aura/window_event_dispatcher.h" |
| 30 #include "ui/base/l10n/l10n_util.h" | 30 #include "ui/base/l10n/l10n_util.h" |
| 31 #include "ui/gfx/screen.h" | 31 #include "ui/display/screen.h" |
| 32 #include "ui/message_center/message_center_style.h" | 32 #include "ui/message_center/message_center_style.h" |
| 33 #include "ui/message_center/message_center_tray_delegate.h" | 33 #include "ui/message_center/message_center_tray_delegate.h" |
| 34 #include "ui/message_center/views/message_bubble_base.h" | 34 #include "ui/message_center/views/message_bubble_base.h" |
| 35 #include "ui/message_center/views/message_center_bubble.h" | 35 #include "ui/message_center/views/message_center_bubble.h" |
| 36 #include "ui/message_center/views/message_popup_collection.h" | 36 #include "ui/message_center/views/message_popup_collection.h" |
| 37 #include "ui/strings/grit/ui_strings.h" | 37 #include "ui/strings/grit/ui_strings.h" |
| 38 #include "ui/views/bubble/tray_bubble_view.h" | 38 #include "ui/views/bubble/tray_bubble_view.h" |
| 39 #include "ui/views/controls/button/custom_button.h" | 39 #include "ui/views/controls/button/custom_button.h" |
| 40 #include "ui/views/controls/image_view.h" | 40 #include "ui/views/controls/image_view.h" |
| 41 #include "ui/views/controls/label.h" | 41 #include "ui/views/controls/label.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 message_center::MessageCenter::Get())); | 185 message_center::MessageCenter::Get())); |
| 186 popup_alignment_delegate_.reset(new AshPopupAlignmentDelegate( | 186 popup_alignment_delegate_.reset(new AshPopupAlignmentDelegate( |
| 187 status_area_widget->shelf_widget()->shelf_layout_manager())); | 187 status_area_widget->shelf_widget()->shelf_layout_manager())); |
| 188 popup_collection_.reset(new message_center::MessagePopupCollection( | 188 popup_collection_.reset(new message_center::MessagePopupCollection( |
| 189 ash::Shell::GetContainer( | 189 ash::Shell::GetContainer( |
| 190 status_area_widget->GetNativeView()->GetRootWindow(), | 190 status_area_widget->GetNativeView()->GetRootWindow(), |
| 191 kShellWindowId_StatusContainer), | 191 kShellWindowId_StatusContainer), |
| 192 message_center(), | 192 message_center(), |
| 193 message_center_tray_.get(), | 193 message_center_tray_.get(), |
| 194 popup_alignment_delegate_.get())); | 194 popup_alignment_delegate_.get())); |
| 195 const gfx::Display& display = | 195 const display::Display& display = |
| 196 gfx::Screen::GetScreen()->GetDisplayNearestWindow( | 196 display::Screen::GetScreen()->GetDisplayNearestWindow( |
| 197 status_area_widget->GetNativeView()); | 197 status_area_widget->GetNativeView()); |
| 198 popup_alignment_delegate_->StartObserving(gfx::Screen::GetScreen(), display); | 198 popup_alignment_delegate_->StartObserving(display::Screen::GetScreen(), |
| 199 display); |
| 199 OnMessageCenterTrayChanged(); | 200 OnMessageCenterTrayChanged(); |
| 200 } | 201 } |
| 201 | 202 |
| 202 WebNotificationTray::~WebNotificationTray() { | 203 WebNotificationTray::~WebNotificationTray() { |
| 203 // Release any child views that might have back pointers before ~View(). | 204 // Release any child views that might have back pointers before ~View(). |
| 204 message_center_bubble_.reset(); | 205 message_center_bubble_.reset(); |
| 205 popup_alignment_delegate_.reset(); | 206 popup_alignment_delegate_.reset(); |
| 206 popup_collection_.reset(); | 207 popup_collection_.reset(); |
| 207 } | 208 } |
| 208 | 209 |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 | 479 |
| 479 message_center::MessageCenterBubble* | 480 message_center::MessageCenterBubble* |
| 480 WebNotificationTray::GetMessageCenterBubbleForTest() { | 481 WebNotificationTray::GetMessageCenterBubbleForTest() { |
| 481 if (!message_center_bubble()) | 482 if (!message_center_bubble()) |
| 482 return NULL; | 483 return NULL; |
| 483 return static_cast<message_center::MessageCenterBubble*>( | 484 return static_cast<message_center::MessageCenterBubble*>( |
| 484 message_center_bubble()->bubble()); | 485 message_center_bubble()->bubble()); |
| 485 } | 486 } |
| 486 | 487 |
| 487 } // namespace ash | 488 } // namespace ash |
| OLD | NEW |