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 "chrome/browser/ui/ash/chrome_shell_delegate.h" | 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
6 | 6 |
7 #include "ash/host/root_window_host_factory.h" | 7 #include "ash/host/root_window_host_factory.h" |
8 #include "ash/launcher/launcher_types.h" | 8 #include "ash/launcher/launcher_types.h" |
9 #include "ash/magnifier/magnifier_constants.h" | 9 #include "ash/magnifier/magnifier_constants.h" |
10 #include "ash/system/tray/system_tray_delegate.h" | 10 #include "ash/system/tray/system_tray_delegate.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "content/public/browser/web_contents.h" | 43 #include "content/public/browser/web_contents.h" |
44 #include "grit/generated_resources.h" | 44 #include "grit/generated_resources.h" |
45 #include "ui/aura/client/user_action_client.h" | 45 #include "ui/aura/client/user_action_client.h" |
46 #include "ui/aura/window.h" | 46 #include "ui/aura/window.h" |
47 | 47 |
48 #if defined(OS_CHROMEOS) | 48 #if defined(OS_CHROMEOS) |
49 #include "ash/keyboard_overlay/keyboard_overlay_view.h" | 49 #include "ash/keyboard_overlay/keyboard_overlay_view.h" |
50 #include "base/chromeos/chromeos_version.h" | 50 #include "base/chromeos/chromeos_version.h" |
51 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" | 51 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
52 #include "chrome/browser/chromeos/background/ash_user_wallpaper_delegate.h" | 52 #include "chrome/browser/chromeos/background/ash_user_wallpaper_delegate.h" |
| 53 #include "chrome/browser/chromeos/extensions/media_player_api.h" |
53 #include "chrome/browser/chromeos/extensions/media_player_event_router.h" | 54 #include "chrome/browser/chromeos/extensions/media_player_event_router.h" |
54 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" | 55 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" |
55 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 56 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
56 #include "chrome/browser/chromeos/login/user_manager.h" | 57 #include "chrome/browser/chromeos/login/user_manager.h" |
57 #include "chrome/browser/chromeos/login/webui_login_display_host.h" | 58 #include "chrome/browser/chromeos/login/webui_login_display_host.h" |
58 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h" | 59 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h" |
59 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 60 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
60 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h" | 61 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h" |
61 #include "chromeos/dbus/dbus_thread_manager.h" | 62 #include "chromeos/dbus/dbus_thread_manager.h" |
62 #include "chromeos/dbus/power_manager_client.h" | 63 #include "chromeos/dbus/power_manager_client.h" |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 break; | 486 break; |
486 case ash::UMA_ACCEL_KEYBOARD_BRIGHTNESS_UP_F7: | 487 case ash::UMA_ACCEL_KEYBOARD_BRIGHTNESS_UP_F7: |
487 content::RecordAction( | 488 content::RecordAction( |
488 content::UserMetricsAction("Accel_KeyboardBrightnessUp_F7")); | 489 content::UserMetricsAction("Accel_KeyboardBrightnessUp_F7")); |
489 break; | 490 break; |
490 } | 491 } |
491 } | 492 } |
492 | 493 |
493 void ChromeShellDelegate::HandleMediaNextTrack() { | 494 void ChromeShellDelegate::HandleMediaNextTrack() { |
494 #if defined(OS_CHROMEOS) | 495 #if defined(OS_CHROMEOS) |
495 ExtensionMediaPlayerEventRouter::GetInstance()->NotifyNextTrack(); | 496 extensions::MediaPlayerAPI::Get(GetTargetBrowser()->profile())-> |
| 497 media_player_event_router()->NotifyNextTrack(); |
496 #endif | 498 #endif |
497 } | 499 } |
498 | 500 |
499 void ChromeShellDelegate::HandleMediaPlayPause() { | 501 void ChromeShellDelegate::HandleMediaPlayPause() { |
500 #if defined(OS_CHROMEOS) | 502 #if defined(OS_CHROMEOS) |
501 ExtensionMediaPlayerEventRouter::GetInstance()->NotifyTogglePlayState(); | 503 extensions::MediaPlayerAPI::Get(GetTargetBrowser()->profile())-> |
| 504 media_player_event_router()->NotifyTogglePlayState(); |
502 #endif | 505 #endif |
503 } | 506 } |
504 | 507 |
505 void ChromeShellDelegate::HandleMediaPrevTrack() { | 508 void ChromeShellDelegate::HandleMediaPrevTrack() { |
506 #if defined(OS_CHROMEOS) | 509 #if defined(OS_CHROMEOS) |
507 ExtensionMediaPlayerEventRouter::GetInstance()->NotifyPrevTrack(); | 510 extensions::MediaPlayerAPI::Get(GetTargetBrowser()->profile())-> |
| 511 media_player_event_router()->NotifyPrevTrack(); |
508 #endif | 512 #endif |
509 } | 513 } |
510 | 514 |
511 string16 ChromeShellDelegate::GetTimeRemainingString(base::TimeDelta delta) { | 515 string16 ChromeShellDelegate::GetTimeRemainingString(base::TimeDelta delta) { |
512 return TimeFormat::TimeRemainingLong(delta); | 516 return TimeFormat::TimeRemainingLong(delta); |
513 } | 517 } |
514 | 518 |
515 string16 ChromeShellDelegate::GetTimeDurationLongString(base::TimeDelta delta) { | 519 string16 ChromeShellDelegate::GetTimeDurationLongString(base::TimeDelta delta) { |
516 return TimeFormat::TimeDurationLong(delta); | 520 return TimeFormat::TimeDurationLong(delta); |
517 } | 521 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 ash::Shell::GetInstance()->ShowLauncher(); | 561 ash::Shell::GetInstance()->ShowLauncher(); |
558 break; | 562 break; |
559 default: | 563 default: |
560 NOTREACHED() << "Unexpected notification " << type; | 564 NOTREACHED() << "Unexpected notification " << type; |
561 } | 565 } |
562 #else | 566 #else |
563 // MSVC++ warns about switch statements without any cases. | 567 // MSVC++ warns about switch statements without any cases. |
564 NOTREACHED() << "Unexpected notification " << type; | 568 NOTREACHED() << "Unexpected notification " << type; |
565 #endif | 569 #endif |
566 } | 570 } |
OLD | NEW |