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

Side by Side Diff: ash/shell/window_type_launcher.cc

Issue 14631005: Enable users of NotificationUIManager to specify binary images. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase for relanding. Created 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | ash/system/web_notification/web_notification_tray_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | ash/system/web_notification/web_notification_tray_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698