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 "base/bind.h" | 17 #include "base/bind.h" |
18 #include "base/time.h" | 18 #include "base/time.h" |
19 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
20 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
21 #include "ui/aura/root_window.h" | 21 #include "ui/aura/root_window.h" |
22 #include "ui/aura/window.h" | 22 #include "ui/aura/window.h" |
23 #include "ui/compositor/layer.h" | 23 #include "ui/compositor/layer.h" |
24 #include "ui/gfx/canvas.h" | 24 #include "ui/gfx/canvas.h" |
| 25 #include "ui/message_center/notification_types.h" |
25 #include "ui/views/controls/button/text_button.h" | 26 #include "ui/views/controls/button/text_button.h" |
26 #include "ui/views/controls/menu/menu_item_view.h" | 27 #include "ui/views/controls/menu/menu_item_view.h" |
27 #include "ui/views/controls/menu/menu_runner.h" | 28 #include "ui/views/controls/menu/menu_runner.h" |
28 #include "ui/views/corewm/shadow_types.h" | 29 #include "ui/views/corewm/shadow_types.h" |
29 #include "ui/views/examples/examples_window_with_content.h" | 30 #include "ui/views/examples/examples_window_with_content.h" |
30 #include "ui/views/layout/grid_layout.h" | 31 #include "ui/views/layout/grid_layout.h" |
31 #include "ui/views/test/child_modal_window.h" | 32 #include "ui/views/test/child_modal_window.h" |
32 #include "ui/views/widget/widget.h" | 33 #include "ui/views/widget/widget.h" |
33 | 34 |
34 using views::MenuItemView; | 35 using views::MenuItemView; |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 } else if (sender == show_screensaver_) { | 336 } else if (sender == show_screensaver_) { |
336 ash::ShowScreensaver(GURL("http://www.google.com")); | 337 ash::ShowScreensaver(GURL("http://www.google.com")); |
337 content::BrowserThread::PostDelayedTask(content::BrowserThread::UI, | 338 content::BrowserThread::PostDelayedTask(content::BrowserThread::UI, |
338 FROM_HERE, | 339 FROM_HERE, |
339 base::Bind(&ash::CloseScreensaver), | 340 base::Bind(&ash::CloseScreensaver), |
340 base::TimeDelta::FromSeconds(5)); | 341 base::TimeDelta::FromSeconds(5)); |
341 | 342 |
342 } else if (sender == show_web_notification_) { | 343 } else if (sender == show_web_notification_) { |
343 ash::Shell::GetPrimaryRootWindowController()->status_area_widget()-> | 344 ash::Shell::GetPrimaryRootWindowController()->status_area_widget()-> |
344 web_notification_tray()->message_center()->AddNotification( | 345 web_notification_tray()->message_center()->AddNotification( |
345 ui::notifications::NOTIFICATION_TYPE_SIMPLE, | 346 message_center::NOTIFICATION_TYPE_SIMPLE, |
346 "id0", | 347 "id0", |
347 ASCIIToUTF16("Test Shell Web Notification"), | 348 ASCIIToUTF16("Test Shell Web Notification"), |
348 ASCIIToUTF16("Notification message body."), | 349 ASCIIToUTF16("Notification message body."), |
349 ASCIIToUTF16("www.testshell.org"), | 350 ASCIIToUTF16("www.testshell.org"), |
350 "" /* extension id */, | 351 "" /* extension id */, |
351 NULL /* optional_fields */); | 352 NULL /* optional_fields */); |
352 } | 353 } |
353 #if !defined(OS_MACOSX) | 354 #if !defined(OS_MACOSX) |
354 else if (sender == examples_button_) { | 355 else if (sender == examples_button_) { |
355 views::examples::ShowExamplesWindowWithContent( | 356 views::examples::ShowExamplesWindowWithContent( |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), | 390 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), |
390 MenuItemView::TOPLEFT, | 391 MenuItemView::TOPLEFT, |
391 MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == | 392 MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == |
392 MenuRunner::MENU_DELETED) | 393 MenuRunner::MENU_DELETED) |
393 return; | 394 return; |
394 } | 395 } |
395 #endif // !defined(OS_MACOSX) | 396 #endif // !defined(OS_MACOSX) |
396 | 397 |
397 } // namespace shell | 398 } // namespace shell |
398 } // namespace ash | 399 } // namespace ash |
OLD | NEW |