Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1455)

Unified Diff: ash/shell/window_type_launcher.cc

Issue 10514008: Add WebNotificationTray (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shell/window_type_launcher.h ('k') | ash/system/status_area_widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell/window_type_launcher.cc
diff --git a/ash/shell/window_type_launcher.cc b/ash/shell/window_type_launcher.cc
index 243273ab6b4734e2b60d61694ffb7b1e44353d0f..b783518335aef3443745f5dadb83eee79ba43c26 100644
--- a/ash/shell/window_type_launcher.cc
+++ b/ash/shell/window_type_launcher.cc
@@ -11,6 +11,8 @@
#include "ash/shell/toplevel_window.h"
#include "ash/shell_delegate.h"
#include "ash/shell_window_ids.h"
+#include "ash/system/status_area_widget.h"
+#include "ash/system/web_notification/web_notification_tray.h"
#include "ash/wm/shadow_types.h"
#include "base/bind.h"
#include "base/time.h"
@@ -223,7 +225,10 @@ WindowTypeLauncher::WindowTypeLauncher()
this, ASCIIToUTF16("Show/Hide a Window")))),
ALLOW_THIS_IN_INITIALIZER_LIST(show_screensaver_(
new views::NativeTextButton(
- this, ASCIIToUTF16("Show the Screensaver [for 5 seconds]")))) {
+ this, ASCIIToUTF16("Show the Screensaver [for 5 seconds]")))),
+ ALLOW_THIS_IN_INITIALIZER_LIST(show_web_notification_(
+ new views::NativeTextButton(
+ this, ASCIIToUTF16("Show a web/app notification")))) {
views::GridLayout* layout = new views::GridLayout(this);
layout->SetInsets(5, 5, 5, 5);
SetLayoutManager(layout);
@@ -247,6 +252,7 @@ WindowTypeLauncher::WindowTypeLauncher()
AddViewToLayout(layout, examples_button_);
AddViewToLayout(layout, show_hide_window_button_);
AddViewToLayout(layout, show_screensaver_);
+ AddViewToLayout(layout, show_web_notification_);
#if !defined(OS_MACOSX)
set_context_menu_controller(this);
#endif
@@ -320,6 +326,14 @@ void WindowTypeLauncher::ButtonPressed(views::Button* sender,
base::Bind(&ash::CloseScreensaver),
base::TimeDelta::FromSeconds(5));
+ } else if (sender == show_web_notification_) {
+ ash::Shell::GetInstance()->status_area_widget()->
+ web_notification_tray()->AddNotification(
+ "id0",
+ ASCIIToUTF16("Test Shell Web Notification"),
+ ASCIIToUTF16("Notification message body."),
+ ASCIIToUTF16("www.testshell.org"),
+ "" /* extension id */);
}
#if !defined(OS_MACOSX)
else if (sender == examples_button_) {
« no previous file with comments | « ash/shell/window_type_launcher.h ('k') | ash/system/status_area_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698