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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 } else if (sender == show_hide_window_button_) { | 340 } else if (sender == show_hide_window_button_) { |
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 scoped_ptr<message_center::Notification> notification; |
| 351 notification.reset(new message_center::Notification( |
| 352 message_center::NOTIFICATION_TYPE_SIMPLE, |
| 353 "id0", |
| 354 ASCIIToUTF16("Test Shell Web Notification"), |
| 355 ASCIIToUTF16("Notification message body."), |
| 356 gfx::Image(), |
| 357 ASCIIToUTF16("www.testshell.org"), |
| 358 "" /* extension id */, |
| 359 NULL /* optional_fields */, |
| 360 NULL /* delegate */)); |
| 361 |
350 ash::Shell::GetPrimaryRootWindowController()->shelf()->status_area_widget() | 362 ash::Shell::GetPrimaryRootWindowController()->shelf()->status_area_widget() |
351 ->web_notification_tray()->message_center() | 363 ->web_notification_tray()->message_center() |
352 ->AddNotification(message_center::NOTIFICATION_TYPE_SIMPLE, | 364 ->AddNotification(notification.Pass()); |
353 "id0", | |
354 ASCIIToUTF16("Test Shell Web Notification"), | |
355 ASCIIToUTF16("Notification message body."), | |
356 ASCIIToUTF16("www.testshell.org"), | |
357 "" /* extension id */, | |
358 NULL /* optional_fields */, | |
359 NULL /* delegate */); | |
360 } | 365 } |
361 #if !defined(OS_MACOSX) | 366 #if !defined(OS_MACOSX) |
362 else if (sender == examples_button_) { | 367 else if (sender == examples_button_) { |
363 views::examples::ShowExamplesWindowWithContent( | 368 views::examples::ShowExamplesWindowWithContent( |
364 views::examples::DO_NOTHING_ON_CLOSE, | 369 views::examples::DO_NOTHING_ON_CLOSE, |
365 ash::Shell::GetInstance()->browser_context()); | 370 ash::Shell::GetInstance()->browser_context()); |
366 } | 371 } |
367 #endif // !defined(OS_MACOSX) | 372 #endif // !defined(OS_MACOSX) |
368 } | 373 } |
369 | 374 |
(...skipping 27 matching lines...) Expand all Loading... |
397 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), | 402 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), |
398 MenuItemView::TOPLEFT, | 403 MenuItemView::TOPLEFT, |
399 MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == | 404 MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == |
400 MenuRunner::MENU_DELETED) | 405 MenuRunner::MENU_DELETED) |
401 return; | 406 return; |
402 } | 407 } |
403 #endif // !defined(OS_MACOSX) | 408 #endif // !defined(OS_MACOSX) |
404 | 409 |
405 } // namespace shell | 410 } // namespace shell |
406 } // namespace ash | 411 } // namespace ash |
OLD | NEW |