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 24 matching lines...) Expand all Loading... |
35 #include "chrome/browser/ui/host_desktop.h" | 35 #include "chrome/browser/ui/host_desktop.h" |
36 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h" | 36 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h" |
37 #include "chrome/common/chrome_notification_types.h" | 37 #include "chrome/common/chrome_notification_types.h" |
38 #include "chrome/common/chrome_switches.h" | 38 #include "chrome/common/chrome_switches.h" |
39 #include "chrome/common/pref_names.h" | 39 #include "chrome/common/pref_names.h" |
40 #include "chrome/common/time_format.h" | 40 #include "chrome/common/time_format.h" |
41 #include "chrome/common/url_constants.h" | 41 #include "chrome/common/url_constants.h" |
42 #include "content/public/browser/notification_service.h" | 42 #include "content/public/browser/notification_service.h" |
43 #include "content/public/browser/user_metrics.h" | 43 #include "content/public/browser/user_metrics.h" |
44 #include "content/public/browser/web_contents.h" | 44 #include "content/public/browser/web_contents.h" |
| 45 #include "grit/chromium_strings.h" |
45 #include "grit/generated_resources.h" | 46 #include "grit/generated_resources.h" |
46 #include "ui/aura/client/user_action_client.h" | 47 #include "ui/aura/client/user_action_client.h" |
47 #include "ui/aura/window.h" | 48 #include "ui/aura/window.h" |
| 49 #include "ui/base/l10n/l10n_util.h" |
48 | 50 |
49 #if defined(OS_CHROMEOS) | 51 #if defined(OS_CHROMEOS) |
50 #include "ash/keyboard_overlay/keyboard_overlay_view.h" | 52 #include "ash/keyboard_overlay/keyboard_overlay_view.h" |
51 #include "base/chromeos/chromeos_version.h" | 53 #include "base/chromeos/chromeos_version.h" |
52 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" | 54 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
53 #include "chrome/browser/chromeos/background/ash_user_wallpaper_delegate.h" | 55 #include "chrome/browser/chromeos/background/ash_user_wallpaper_delegate.h" |
54 #include "chrome/browser/chromeos/extensions/media_player_api.h" | 56 #include "chrome/browser/chromeos/extensions/media_player_api.h" |
55 #include "chrome/browser/chromeos/extensions/media_player_event_router.h" | 57 #include "chrome/browser/chromeos/extensions/media_player_event_router.h" |
56 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" | 58 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" |
57 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 59 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 if (chrome::IsRunningInAppMode()) | 591 if (chrome::IsRunningInAppMode()) |
590 return NULL; | 592 return NULL; |
591 | 593 |
592 return new LauncherContextMenu(launcher_delegate_, root); | 594 return new LauncherContextMenu(launcher_delegate_, root); |
593 } | 595 } |
594 | 596 |
595 ash::RootWindowHostFactory* ChromeShellDelegate::CreateRootWindowHostFactory() { | 597 ash::RootWindowHostFactory* ChromeShellDelegate::CreateRootWindowHostFactory() { |
596 return ash::RootWindowHostFactory::Create(); | 598 return ash::RootWindowHostFactory::Create(); |
597 } | 599 } |
598 | 600 |
| 601 string16 ChromeShellDelegate::GetProductName() const { |
| 602 return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); |
| 603 } |
| 604 |
599 void ChromeShellDelegate::Observe(int type, | 605 void ChromeShellDelegate::Observe(int type, |
600 const content::NotificationSource& source, | 606 const content::NotificationSource& source, |
601 const content::NotificationDetails& details) { | 607 const content::NotificationDetails& details) { |
602 #if defined(OS_CHROMEOS) | 608 #if defined(OS_CHROMEOS) |
603 switch (type) { | 609 switch (type) { |
604 case chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED: | 610 case chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED: |
605 ash::Shell::GetInstance()->CreateLauncher(); | 611 ash::Shell::GetInstance()->CreateLauncher(); |
606 break; | 612 break; |
607 case chrome::NOTIFICATION_SESSION_STARTED: | 613 case chrome::NOTIFICATION_SESSION_STARTED: |
608 ash::Shell::GetInstance()->ShowLauncher(); | 614 ash::Shell::GetInstance()->ShowLauncher(); |
609 break; | 615 break; |
610 default: | 616 default: |
611 NOTREACHED() << "Unexpected notification " << type; | 617 NOTREACHED() << "Unexpected notification " << type; |
612 } | 618 } |
613 #else | 619 #else |
614 // MSVC++ warns about switch statements without any cases. | 620 // MSVC++ warns about switch statements without any cases. |
615 NOTREACHED() << "Unexpected notification " << type; | 621 NOTREACHED() << "Unexpected notification " << type; |
616 #endif | 622 #endif |
617 } | 623 } |
OLD | NEW |