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

Side by Side Diff: chrome/browser/ui/ash/chrome_shell_delegate.cc

Issue 10823439: Ash: Support "Next Song", "Previous Song", "Play/Pause" Multi Media buttons (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixed nits Created 8 years, 4 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
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 "chrome/browser/ui/ash/chrome_shell_delegate.h" 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h"
6 6
7 #include "ash/launcher/launcher_types.h" 7 #include "ash/launcher/launcher_types.h"
8 #include "ash/system/tray/system_tray_delegate.h" 8 #include "ash/system/tray/system_tray_delegate.h"
9 #include "ash/wm/window_util.h" 9 #include "ash/wm/window_util.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 21 matching lines...) Expand all
32 #include "grit/generated_resources.h" 32 #include "grit/generated_resources.h"
33 #include "ui/aura/client/user_action_client.h" 33 #include "ui/aura/client/user_action_client.h"
34 #include "ui/aura/window.h" 34 #include "ui/aura/window.h"
35 35
36 #if defined(OS_CHROMEOS) 36 #if defined(OS_CHROMEOS)
37 #include "ash/keyboard_overlay/keyboard_overlay_view.h" 37 #include "ash/keyboard_overlay/keyboard_overlay_view.h"
38 #include "base/chromeos/chromeos_version.h" 38 #include "base/chromeos/chromeos_version.h"
39 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" 39 #include "chrome/browser/chromeos/accessibility/accessibility_util.h"
40 #include "chrome/browser/chromeos/background/ash_user_wallpaper_delegate.h" 40 #include "chrome/browser/chromeos/background/ash_user_wallpaper_delegate.h"
41 #include "chrome/browser/chromeos/extensions/file_manager_util.h" 41 #include "chrome/browser/chromeos/extensions/file_manager_util.h"
42 #include "chrome/browser/chromeos/extensions/media_player_event_router.h"
42 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" 43 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h"
43 #include "chrome/browser/chromeos/login/user_manager.h" 44 #include "chrome/browser/chromeos/login/user_manager.h"
44 #include "chrome/browser/chromeos/login/webui_login_display_host.h" 45 #include "chrome/browser/chromeos/login/webui_login_display_host.h"
45 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h" 46 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h"
46 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" 47 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
47 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h" 48 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h"
48 #include "chromeos/dbus/dbus_thread_manager.h" 49 #include "chromeos/dbus/dbus_thread_manager.h"
49 #include "chromeos/dbus/power_manager_client.h" 50 #include "chromeos/dbus/power_manager_client.h"
50 #include "chromeos/dbus/session_manager_client.h" 51 #include "chromeos/dbus/session_manager_client.h"
51 #endif 52 #endif
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 case ash::UMA_LAUNCHER_CLICK_ON_APPLIST_BUTTON: 357 case ash::UMA_LAUNCHER_CLICK_ON_APPLIST_BUTTON:
357 content::RecordAction( 358 content::RecordAction(
358 content::UserMetricsAction("Launcher_ClickOnApplistButton")); 359 content::UserMetricsAction("Launcher_ClickOnApplistButton"));
359 break; 360 break;
360 case ash::UMA_LAUNCHER_CLICK_ON_APP: 361 case ash::UMA_LAUNCHER_CLICK_ON_APP:
361 content::RecordAction(content::UserMetricsAction("Launcher_ClickOnApp")); 362 content::RecordAction(content::UserMetricsAction("Launcher_ClickOnApp"));
362 break; 363 break;
363 } 364 }
364 } 365 }
365 366
367 void ChromeShellDelegate::HandleMediaNextTrack() {
368 #if defined(OS_CHROMEOS)
369 ExtensionMediaPlayerEventRouter::GetInstance()->NotifyNextTrack();
370 #endif
371 }
372
373 void ChromeShellDelegate::HandleMediaPlayPause() {
374 #if defined(OS_CHROMEOS)
375 ExtensionMediaPlayerEventRouter::GetInstance()->NotifyTogglePlayState();
376 #endif
377 }
378
379 void ChromeShellDelegate::HandleMediaPrevTrack() {
380 #if defined(OS_CHROMEOS)
381 ExtensionMediaPlayerEventRouter::GetInstance()->NotifyPrevTrack();
382 #endif
383 }
384
366 void ChromeShellDelegate::Observe(int type, 385 void ChromeShellDelegate::Observe(int type,
367 const content::NotificationSource& source, 386 const content::NotificationSource& source,
368 const content::NotificationDetails& details) { 387 const content::NotificationDetails& details) {
369 #if defined(OS_CHROMEOS) 388 #if defined(OS_CHROMEOS)
370 switch (type) { 389 switch (type) {
371 case chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED: 390 case chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED:
372 ash::Shell::GetInstance()->CreateLauncher(); 391 ash::Shell::GetInstance()->CreateLauncher();
373 break; 392 break;
374 case chrome::NOTIFICATION_SESSION_STARTED: 393 case chrome::NOTIFICATION_SESSION_STARTED:
375 ash::Shell::GetInstance()->ShowLauncher(); 394 ash::Shell::GetInstance()->ShowLauncher();
376 break; 395 break;
377 default: 396 default:
378 NOTREACHED() << "Unexpected notification " << type; 397 NOTREACHED() << "Unexpected notification " << type;
379 } 398 }
380 #else 399 #else
381 // MSVC++ warns about switch statements without any cases. 400 // MSVC++ warns about switch statements without any cases.
382 NOTREACHED() << "Unexpected notification " << type; 401 NOTREACHED() << "Unexpected notification " << type;
383 #endif 402 #endif
384 } 403 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698