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/shelf/shelf_widget.h" |
9 #include "ash/shell.h" | 10 #include "ash/shell.h" |
10 #include "ash/shell/example_factory.h" | 11 #include "ash/shell/example_factory.h" |
11 #include "ash/shell/panel_window.h" | 12 #include "ash/shell/panel_window.h" |
12 #include "ash/shell/toplevel_window.h" | 13 #include "ash/shell/toplevel_window.h" |
13 #include "ash/shell_delegate.h" | 14 #include "ash/shell_delegate.h" |
14 #include "ash/shell_window_ids.h" | 15 #include "ash/shell_window_ids.h" |
15 #include "ash/system/status_area_widget.h" | 16 #include "ash/system/status_area_widget.h" |
16 #include "ash/system/web_notification/web_notification_tray.h" | 17 #include "ash/system/web_notification/web_notification_tray.h" |
17 #include "base/bind.h" | 18 #include "base/bind.h" |
18 #include "base/time.h" | 19 #include "base/time.h" |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 } else if (sender == show_hide_window_button_) { | 352 } else if (sender == show_hide_window_button_) { |
352 NonModalTransient::ToggleNonModalTransient(GetWidget()->GetNativeView()); | 353 NonModalTransient::ToggleNonModalTransient(GetWidget()->GetNativeView()); |
353 } else if (sender == show_screensaver_) { | 354 } else if (sender == show_screensaver_) { |
354 ash::ShowScreensaver(GURL("http://www.google.com")); | 355 ash::ShowScreensaver(GURL("http://www.google.com")); |
355 content::BrowserThread::PostDelayedTask(content::BrowserThread::UI, | 356 content::BrowserThread::PostDelayedTask(content::BrowserThread::UI, |
356 FROM_HERE, | 357 FROM_HERE, |
357 base::Bind(&ash::CloseScreensaver), | 358 base::Bind(&ash::CloseScreensaver), |
358 base::TimeDelta::FromSeconds(5)); | 359 base::TimeDelta::FromSeconds(5)); |
359 | 360 |
360 } else if (sender == show_web_notification_) { | 361 } else if (sender == show_web_notification_) { |
361 ash::Shell::GetPrimaryRootWindowController()->status_area_widget()-> | 362 ash::Shell::GetPrimaryRootWindowController()->shelf()->status_area_widget() |
362 web_notification_tray()->message_center()->AddNotification( | 363 ->web_notification_tray()->message_center()->AddNotification( |
363 message_center::NOTIFICATION_TYPE_SIMPLE, | 364 message_center::NOTIFICATION_TYPE_SIMPLE, |
364 "id0", | 365 "id0", |
365 ASCIIToUTF16("Test Shell Web Notification"), | 366 ASCIIToUTF16("Test Shell Web Notification"), |
366 ASCIIToUTF16("Notification message body."), | 367 ASCIIToUTF16("Notification message body."), |
367 ASCIIToUTF16("www.testshell.org"), | 368 ASCIIToUTF16("www.testshell.org"), |
368 "" /* extension id */, | 369 "" /* extension id */, |
369 NULL /* optional_fields */); | 370 NULL /* optional_fields */); |
370 } | 371 } |
371 #if !defined(OS_MACOSX) | 372 #if !defined(OS_MACOSX) |
372 else if (sender == examples_button_) { | 373 else if (sender == examples_button_) { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), | 408 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), |
408 MenuItemView::TOPLEFT, | 409 MenuItemView::TOPLEFT, |
409 MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == | 410 MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == |
410 MenuRunner::MENU_DELETED) | 411 MenuRunner::MENU_DELETED) |
411 return; | 412 return; |
412 } | 413 } |
413 #endif // !defined(OS_MACOSX) | 414 #endif // !defined(OS_MACOSX) |
414 | 415 |
415 } // namespace shell | 416 } // namespace shell |
416 } // namespace ash | 417 } // namespace ash |
OLD | NEW |