| 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 } else if (sender == show_hide_window_button_) { | 335 } else if (sender == show_hide_window_button_) { |
| 335 NonModalTransient::ToggleNonModalTransient(GetWidget()->GetNativeView()); | 336 NonModalTransient::ToggleNonModalTransient(GetWidget()->GetNativeView()); |
| 336 } else if (sender == show_screensaver_) { | 337 } else if (sender == show_screensaver_) { |
| 337 ash::ShowScreensaver(GURL("http://www.google.com")); | 338 ash::ShowScreensaver(GURL("http://www.google.com")); |
| 338 content::BrowserThread::PostDelayedTask(content::BrowserThread::UI, | 339 content::BrowserThread::PostDelayedTask(content::BrowserThread::UI, |
| 339 FROM_HERE, | 340 FROM_HERE, |
| 340 base::Bind(&ash::CloseScreensaver), | 341 base::Bind(&ash::CloseScreensaver), |
| 341 base::TimeDelta::FromSeconds(5)); | 342 base::TimeDelta::FromSeconds(5)); |
| 342 | 343 |
| 343 } else if (sender == show_web_notification_) { | 344 } else if (sender == show_web_notification_) { |
| 344 ash::Shell::GetPrimaryRootWindowController()->status_area_widget()-> | 345 ash::Shell::GetPrimaryRootWindowController()->shelf()->status_area_widget() |
| 345 web_notification_tray()->message_center()->AddNotification( | 346 ->web_notification_tray()->message_center()->AddNotification( |
| 346 message_center::NOTIFICATION_TYPE_SIMPLE, | 347 message_center::NOTIFICATION_TYPE_SIMPLE, |
| 347 "id0", | 348 "id0", |
| 348 ASCIIToUTF16("Test Shell Web Notification"), | 349 ASCIIToUTF16("Test Shell Web Notification"), |
| 349 ASCIIToUTF16("Notification message body."), | 350 ASCIIToUTF16("Notification message body."), |
| 350 ASCIIToUTF16("www.testshell.org"), | 351 ASCIIToUTF16("www.testshell.org"), |
| 351 "" /* extension id */, | 352 "" /* extension id */, |
| 352 NULL /* optional_fields */); | 353 NULL /* optional_fields */); |
| 353 } | 354 } |
| 354 #if !defined(OS_MACOSX) | 355 #if !defined(OS_MACOSX) |
| 355 else if (sender == examples_button_) { | 356 else if (sender == examples_button_) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), | 391 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), |
| 391 MenuItemView::TOPLEFT, | 392 MenuItemView::TOPLEFT, |
| 392 MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == | 393 MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == |
| 393 MenuRunner::MENU_DELETED) | 394 MenuRunner::MENU_DELETED) |
| 394 return; | 395 return; |
| 395 } | 396 } |
| 396 #endif // !defined(OS_MACOSX) | 397 #endif // !defined(OS_MACOSX) |
| 397 | 398 |
| 398 } // namespace shell | 399 } // namespace shell |
| 399 } // namespace ash | 400 } // namespace ash |
| OLD | NEW |