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 "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
8 #include "ash/screensaver/screensaver_view.h" | 8 #include "ash/screensaver/screensaver_view.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell/example_factory.h" | 10 #include "ash/shell/example_factory.h" |
11 #include "ash/shell/panel_window.h" | 11 #include "ash/shell/panel_window.h" |
12 #include "ash/shell/toplevel_window.h" | 12 #include "ash/shell/toplevel_window.h" |
13 #include "ash/shell_delegate.h" | 13 #include "ash/shell_delegate.h" |
14 #include "ash/shell_window_ids.h" | 14 #include "ash/shell_window_ids.h" |
15 #include "ash/system/status_area_widget.h" | 15 #include "ash/system/status_area_widget.h" |
16 #include "ash/system/web_notification/web_notification_tray.h" | 16 #include "ash/system/web_notification/web_notification_tray.h" |
17 #include "ash/test/child_modal_window.h" | |
18 #include "base/bind.h" | 17 #include "base/bind.h" |
19 #include "base/time.h" | 18 #include "base/time.h" |
20 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
21 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
22 #include "ui/aura/root_window.h" | 21 #include "ui/aura/root_window.h" |
23 #include "ui/aura/window.h" | 22 #include "ui/aura/window.h" |
24 #include "ui/compositor/layer.h" | 23 #include "ui/compositor/layer.h" |
25 #include "ui/gfx/canvas.h" | 24 #include "ui/gfx/canvas.h" |
26 #include "ui/views/controls/button/text_button.h" | 25 #include "ui/views/controls/button/text_button.h" |
27 #include "ui/views/controls/menu/menu_item_view.h" | 26 #include "ui/views/controls/menu/menu_item_view.h" |
28 #include "ui/views/controls/menu/menu_runner.h" | 27 #include "ui/views/controls/menu/menu_runner.h" |
29 #include "ui/views/corewm/shadow_types.h" | 28 #include "ui/views/corewm/shadow_types.h" |
30 #include "ui/views/examples/examples_window_with_content.h" | 29 #include "ui/views/examples/examples_window_with_content.h" |
31 #include "ui/views/layout/grid_layout.h" | 30 #include "ui/views/layout/grid_layout.h" |
| 31 #include "ui/views/test/child_modal_window.h" |
32 #include "ui/views/widget/widget.h" | 32 #include "ui/views/widget/widget.h" |
33 | 33 |
34 using views::MenuItemView; | 34 using views::MenuItemView; |
35 using views::MenuRunner; | 35 using views::MenuRunner; |
36 | 36 |
37 namespace ash { | 37 namespace ash { |
38 namespace shell { | 38 namespace shell { |
39 | 39 |
40 namespace { | 40 namespace { |
41 | 41 |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 Shell::GetInstance()->delegate()->LockScreen(); | 315 Shell::GetInstance()->delegate()->LockScreen(); |
316 } else if (sender == widgets_button_) { | 316 } else if (sender == widgets_button_) { |
317 CreateWidgetsWindow(); | 317 CreateWidgetsWindow(); |
318 } else if (sender == system_modal_button_) { | 318 } else if (sender == system_modal_button_) { |
319 ModalWindow::OpenModalWindow(GetWidget()->GetNativeView(), | 319 ModalWindow::OpenModalWindow(GetWidget()->GetNativeView(), |
320 ui::MODAL_TYPE_SYSTEM); | 320 ui::MODAL_TYPE_SYSTEM); |
321 } else if (sender == window_modal_button_) { | 321 } else if (sender == window_modal_button_) { |
322 ModalWindow::OpenModalWindow(GetWidget()->GetNativeView(), | 322 ModalWindow::OpenModalWindow(GetWidget()->GetNativeView(), |
323 ui::MODAL_TYPE_WINDOW); | 323 ui::MODAL_TYPE_WINDOW); |
324 } else if (sender == child_modal_button_) { | 324 } else if (sender == child_modal_button_) { |
325 ash::test::CreateChildModalParent(); | 325 views::test::CreateChildModalParent(); |
326 } else if (sender == transient_button_) { | 326 } else if (sender == transient_button_) { |
327 NonModalTransient::OpenNonModalTransient(GetWidget()->GetNativeView()); | 327 NonModalTransient::OpenNonModalTransient(GetWidget()->GetNativeView()); |
328 } else if (sender == show_hide_window_button_) { | 328 } else if (sender == show_hide_window_button_) { |
329 NonModalTransient::ToggleNonModalTransient(GetWidget()->GetNativeView()); | 329 NonModalTransient::ToggleNonModalTransient(GetWidget()->GetNativeView()); |
330 } else if (sender == show_screensaver_) { | 330 } else if (sender == show_screensaver_) { |
331 ash::ShowScreensaver(GURL("http://www.google.com")); | 331 ash::ShowScreensaver(GURL("http://www.google.com")); |
332 content::BrowserThread::PostDelayedTask(content::BrowserThread::UI, | 332 content::BrowserThread::PostDelayedTask(content::BrowserThread::UI, |
333 FROM_HERE, | 333 FROM_HERE, |
334 base::Bind(&ash::CloseScreensaver), | 334 base::Bind(&ash::CloseScreensaver), |
335 base::TimeDelta::FromSeconds(5)); | 335 base::TimeDelta::FromSeconds(5)); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), | 384 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), |
385 MenuItemView::TOPLEFT, | 385 MenuItemView::TOPLEFT, |
386 MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == | 386 MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == |
387 MenuRunner::MENU_DELETED) | 387 MenuRunner::MENU_DELETED) |
388 return; | 388 return; |
389 } | 389 } |
390 #endif // !defined(OS_MACOSX) | 390 #endif // !defined(OS_MACOSX) |
391 | 391 |
392 } // namespace shell | 392 } // namespace shell |
393 } // namespace ash | 393 } // namespace ash |
OLD | NEW |