| 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/shell/window_type_launcher.h" | 5 #include "ash/shell/window_type_launcher.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/common/session/session_state_delegate.h" | 9 #include "ash/common/session/session_state_delegate.h" |
| 10 #include "ash/common/shell_window_ids.h" | 10 #include "ash/common/shell_window_ids.h" |
| 11 #include "ash/common/system/web_notification/web_notification_tray.h" | 11 #include "ash/common/system/web_notification/web_notification_tray.h" |
| 12 #include "ash/common/wm_shell.h" |
| 12 #include "ash/content/shell_content_state.h" | 13 #include "ash/content/shell_content_state.h" |
| 13 #include "ash/root_window_controller.h" | 14 #include "ash/root_window_controller.h" |
| 14 #include "ash/shelf/shelf_widget.h" | 15 #include "ash/shelf/shelf_widget.h" |
| 15 #include "ash/shell.h" | 16 #include "ash/shell.h" |
| 16 #include "ash/shell/example_factory.h" | 17 #include "ash/shell/example_factory.h" |
| 17 #include "ash/shell/panel_window.h" | 18 #include "ash/shell/panel_window.h" |
| 18 #include "ash/shell/toplevel_window.h" | 19 #include "ash/shell/toplevel_window.h" |
| 19 #include "ash/shell_delegate.h" | 20 #include "ash/shell_delegate.h" |
| 20 #include "ash/system/status_area_widget.h" | 21 #include "ash/system/status_area_widget.h" |
| 21 #include "ash/test/child_modal_window.h" | 22 #include "ash/test/child_modal_window.h" |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 params.can_resize = true; | 285 params.can_resize = true; |
| 285 params.can_maximize = true; | 286 params.can_maximize = true; |
| 286 ToplevelWindow::CreateToplevelWindow(params); | 287 ToplevelWindow::CreateToplevelWindow(params); |
| 287 } else if (sender == panel_button_) { | 288 } else if (sender == panel_button_) { |
| 288 PanelWindow::CreatePanelWindow(gfx::Rect()); | 289 PanelWindow::CreatePanelWindow(gfx::Rect()); |
| 289 } else if (sender == create_nonresizable_button_) { | 290 } else if (sender == create_nonresizable_button_) { |
| 290 ToplevelWindow::CreateToplevelWindow(ToplevelWindow::CreateParams()); | 291 ToplevelWindow::CreateToplevelWindow(ToplevelWindow::CreateParams()); |
| 291 } else if (sender == bubble_button_) { | 292 } else if (sender == bubble_button_) { |
| 292 CreatePointyBubble(sender); | 293 CreatePointyBubble(sender); |
| 293 } else if (sender == lock_button_) { | 294 } else if (sender == lock_button_) { |
| 294 Shell::GetInstance()->session_state_delegate()->LockScreen(); | 295 WmShell::Get()->GetSessionStateDelegate()->LockScreen(); |
| 295 } else if (sender == widgets_button_) { | 296 } else if (sender == widgets_button_) { |
| 296 CreateWidgetsWindow(); | 297 CreateWidgetsWindow(); |
| 297 } else if (sender == system_modal_button_) { | 298 } else if (sender == system_modal_button_) { |
| 298 ModalWindow::OpenModalWindow(GetWidget()->GetNativeView(), | 299 ModalWindow::OpenModalWindow(GetWidget()->GetNativeView(), |
| 299 ui::MODAL_TYPE_SYSTEM); | 300 ui::MODAL_TYPE_SYSTEM); |
| 300 } else if (sender == window_modal_button_) { | 301 } else if (sender == window_modal_button_) { |
| 301 ModalWindow::OpenModalWindow(GetWidget()->GetNativeView(), | 302 ModalWindow::OpenModalWindow(GetWidget()->GetNativeView(), |
| 302 ui::MODAL_TYPE_WINDOW); | 303 ui::MODAL_TYPE_WINDOW); |
| 303 } else if (sender == child_modal_button_) { | 304 } else if (sender == child_modal_button_) { |
| 304 ash::test::CreateChildModalParent( | 305 test::CreateChildModalParent(GetWidget()->GetNativeView()->GetRootWindow()); |
| 305 GetWidget()->GetNativeView()->GetRootWindow()); | |
| 306 } else if (sender == transient_button_) { | 306 } else if (sender == transient_button_) { |
| 307 NonModalTransient::OpenNonModalTransient(GetWidget()->GetNativeView()); | 307 NonModalTransient::OpenNonModalTransient(GetWidget()->GetNativeView()); |
| 308 } else if (sender == show_hide_window_button_) { | 308 } else if (sender == show_hide_window_button_) { |
| 309 NonModalTransient::ToggleNonModalTransient(GetWidget()->GetNativeView()); | 309 NonModalTransient::ToggleNonModalTransient(GetWidget()->GetNativeView()); |
| 310 } else if (sender == show_web_notification_) { | 310 } else if (sender == show_web_notification_) { |
| 311 std::unique_ptr<message_center::Notification> notification; | 311 std::unique_ptr<message_center::Notification> notification; |
| 312 notification.reset(new message_center::Notification( | 312 notification.reset(new message_center::Notification( |
| 313 message_center::NOTIFICATION_TYPE_SIMPLE, "id0", | 313 message_center::NOTIFICATION_TYPE_SIMPLE, "id0", |
| 314 base::ASCIIToUTF16("Test Shell Web Notification"), | 314 base::ASCIIToUTF16("Test Shell Web Notification"), |
| 315 base::ASCIIToUTF16("Notification message body."), gfx::Image(), | 315 base::ASCIIToUTF16("Notification message body."), gfx::Image(), |
| 316 base::ASCIIToUTF16("www.testshell.org"), GURL(), | 316 base::ASCIIToUTF16("www.testshell.org"), GURL(), |
| 317 message_center::NotifierId(message_center::NotifierId::APPLICATION, | 317 message_center::NotifierId(message_center::NotifierId::APPLICATION, |
| 318 "test-id"), | 318 "test-id"), |
| 319 message_center::RichNotificationData(), NULL /* delegate */)); | 319 message_center::RichNotificationData(), NULL /* delegate */)); |
| 320 | 320 |
| 321 ash::Shell::GetPrimaryRootWindowController() | 321 Shell::GetPrimaryRootWindowController() |
| 322 ->shelf_widget() | 322 ->shelf_widget() |
| 323 ->status_area_widget() | 323 ->status_area_widget() |
| 324 ->web_notification_tray() | 324 ->web_notification_tray() |
| 325 ->message_center() | 325 ->message_center() |
| 326 ->AddNotification(std::move(notification)); | 326 ->AddNotification(std::move(notification)); |
| 327 } else if (sender == examples_button_) { | 327 } else if (sender == examples_button_) { |
| 328 views::examples::ShowExamplesWindowWithContent( | 328 views::examples::ShowExamplesWindowWithContent( |
| 329 views::examples::DO_NOTHING_ON_CLOSE, | 329 views::examples::DO_NOTHING_ON_CLOSE, |
| 330 ShellContentState::GetInstance()->GetActiveBrowserContext(), NULL); | 330 ShellContentState::GetInstance()->GetActiveBrowserContext(), NULL); |
| 331 } | 331 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 360 views::MenuRunner::ASYNC)); | 360 views::MenuRunner::ASYNC)); |
| 361 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), | 361 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), |
| 362 views::MENU_ANCHOR_TOPLEFT, | 362 views::MENU_ANCHOR_TOPLEFT, |
| 363 source_type) == MenuRunner::MENU_DELETED) { | 363 source_type) == MenuRunner::MENU_DELETED) { |
| 364 return; | 364 return; |
| 365 } | 365 } |
| 366 } | 366 } |
| 367 | 367 |
| 368 } // namespace shell | 368 } // namespace shell |
| 369 } // namespace ash | 369 } // namespace ash |
| OLD | NEW |