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/session_state_delegate.h" | 9 #include "ash/session_state_delegate.h" |
10 #include "ash/shelf/shelf_widget.h" | 10 #include "ash/shelf/shelf_widget.h" |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 NonModalTransient::ToggleNonModalTransient(GetWidget()->GetNativeView()); | 341 NonModalTransient::ToggleNonModalTransient(GetWidget()->GetNativeView()); |
342 } else if (sender == show_screensaver_) { | 342 } else if (sender == show_screensaver_) { |
343 ash::ShowScreensaver(GURL("http://www.google.com")); | 343 ash::ShowScreensaver(GURL("http://www.google.com")); |
344 content::BrowserThread::PostDelayedTask(content::BrowserThread::UI, | 344 content::BrowserThread::PostDelayedTask(content::BrowserThread::UI, |
345 FROM_HERE, | 345 FROM_HERE, |
346 base::Bind(&ash::CloseScreensaver), | 346 base::Bind(&ash::CloseScreensaver), |
347 base::TimeDelta::FromSeconds(5)); | 347 base::TimeDelta::FromSeconds(5)); |
348 | 348 |
349 } else if (sender == show_web_notification_) { | 349 } else if (sender == show_web_notification_) { |
350 ash::Shell::GetPrimaryRootWindowController()->shelf()->status_area_widget() | 350 ash::Shell::GetPrimaryRootWindowController()->shelf()->status_area_widget() |
351 ->web_notification_tray()->message_center()->AddNotification( | 351 ->web_notification_tray()->message_center() |
352 message_center::NOTIFICATION_TYPE_SIMPLE, | 352 ->AddNotification(message_center::NOTIFICATION_TYPE_SIMPLE, |
353 "id0", | 353 "id0", |
354 ASCIIToUTF16("Test Shell Web Notification"), | 354 ASCIIToUTF16("Test Shell Web Notification"), |
355 ASCIIToUTF16("Notification message body."), | 355 ASCIIToUTF16("Notification message body."), |
356 ASCIIToUTF16("www.testshell.org"), | 356 ASCIIToUTF16("www.testshell.org"), |
357 "" /* extension id */, | 357 "" /* extension id */, |
358 NULL /* optional_fields */); | 358 NULL /* optional_fields */, |
| 359 NULL /* delegate */); |
359 } | 360 } |
360 #if !defined(OS_MACOSX) | 361 #if !defined(OS_MACOSX) |
361 else if (sender == examples_button_) { | 362 else if (sender == examples_button_) { |
362 views::examples::ShowExamplesWindowWithContent( | 363 views::examples::ShowExamplesWindowWithContent( |
363 views::examples::DO_NOTHING_ON_CLOSE, | 364 views::examples::DO_NOTHING_ON_CLOSE, |
364 ash::Shell::GetInstance()->browser_context()); | 365 ash::Shell::GetInstance()->browser_context()); |
365 } | 366 } |
366 #endif // !defined(OS_MACOSX) | 367 #endif // !defined(OS_MACOSX) |
367 } | 368 } |
368 | 369 |
369 #if !defined(OS_MACOSX) | 370 #if !defined(OS_MACOSX) |
370 void WindowTypeLauncher::ExecuteCommand(int id, int event_flags) { | 371 void WindowTypeLauncher::ExecuteCommand(int id, int event_flags) { |
371 switch (id) { | 372 switch (id) { |
(...skipping 24 matching lines...) Expand all Loading... |
396 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), | 397 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), |
397 MenuItemView::TOPLEFT, | 398 MenuItemView::TOPLEFT, |
398 MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == | 399 MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == |
399 MenuRunner::MENU_DELETED) | 400 MenuRunner::MENU_DELETED) |
400 return; | 401 return; |
401 } | 402 } |
402 #endif // !defined(OS_MACOSX) | 403 #endif // !defined(OS_MACOSX) |
403 | 404 |
404 } // namespace shell | 405 } // namespace shell |
405 } // namespace ash | 406 } // namespace ash |
OLD | NEW |