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" |
11 #include "ash/wm/window_properties.h" | 11 #include "ash/wm/window_properties.h" |
12 #include "ash/wm/window_util.h" | 12 #include "ash/wm/window_util.h" |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "chrome/browser/app_mode/app_mode_utils.h" |
15 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 16 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
16 #include "chrome/browser/chromeos/login/screen_locker.h" | 17 #include "chrome/browser/chromeos/login/screen_locker.h" |
17 #include "chrome/browser/extensions/api/terminal/terminal_extension_helper.h" | 18 #include "chrome/browser/extensions/api/terminal/terminal_extension_helper.h" |
18 #include "chrome/browser/lifetime/application_lifetime.h" | 19 #include "chrome/browser/lifetime/application_lifetime.h" |
19 #include "chrome/browser/prefs/pref_service.h" | 20 #include "chrome/browser/prefs/pref_service.h" |
20 #include "chrome/browser/profiles/profile_manager.h" | 21 #include "chrome/browser/profiles/profile_manager.h" |
21 #include "chrome/browser/sessions/tab_restore_service.h" | 22 #include "chrome/browser/sessions/tab_restore_service.h" |
22 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 23 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
23 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" | 24 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" |
24 #include "chrome/browser/ui/ash/app_list/app_list_controller_ash.h" | 25 #include "chrome/browser/ui/ash/app_list/app_list_controller_ash.h" |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 if (chromeos::MagnificationManager::Get()) { | 578 if (chromeos::MagnificationManager::Get()) { |
578 return chromeos::MagnificationManager::Get()-> | 579 return chromeos::MagnificationManager::Get()-> |
579 GetSavedScreenMagnifierScale(); | 580 GetSavedScreenMagnifierScale(); |
580 } | 581 } |
581 #endif | 582 #endif |
582 return std::numeric_limits<double>::min(); | 583 return std::numeric_limits<double>::min(); |
583 } | 584 } |
584 | 585 |
585 ui::MenuModel* ChromeShellDelegate::CreateContextMenu(aura::RootWindow* root) { | 586 ui::MenuModel* ChromeShellDelegate::CreateContextMenu(aura::RootWindow* root) { |
586 DCHECK(launcher_delegate_); | 587 DCHECK(launcher_delegate_); |
| 588 // Don't show context menu for exclusive app runtime mode. |
| 589 if (chrome::IsRunningInAppMode()) |
| 590 return NULL; |
| 591 |
587 return new LauncherContextMenu(launcher_delegate_, root); | 592 return new LauncherContextMenu(launcher_delegate_, root); |
588 } | 593 } |
589 | 594 |
590 ash::RootWindowHostFactory* ChromeShellDelegate::CreateRootWindowHostFactory() { | 595 ash::RootWindowHostFactory* ChromeShellDelegate::CreateRootWindowHostFactory() { |
591 return ash::RootWindowHostFactory::Create(); | 596 return ash::RootWindowHostFactory::Create(); |
592 } | 597 } |
593 | 598 |
594 void ChromeShellDelegate::Observe(int type, | 599 void ChromeShellDelegate::Observe(int type, |
595 const content::NotificationSource& source, | 600 const content::NotificationSource& source, |
596 const content::NotificationDetails& details) { | 601 const content::NotificationDetails& details) { |
597 #if defined(OS_CHROMEOS) | 602 #if defined(OS_CHROMEOS) |
598 switch (type) { | 603 switch (type) { |
599 case chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED: | 604 case chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED: |
600 ash::Shell::GetInstance()->CreateLauncher(); | 605 ash::Shell::GetInstance()->CreateLauncher(); |
601 break; | 606 break; |
602 case chrome::NOTIFICATION_SESSION_STARTED: | 607 case chrome::NOTIFICATION_SESSION_STARTED: |
603 ash::Shell::GetInstance()->ShowLauncher(); | 608 ash::Shell::GetInstance()->ShowLauncher(); |
604 break; | 609 break; |
605 default: | 610 default: |
606 NOTREACHED() << "Unexpected notification " << type; | 611 NOTREACHED() << "Unexpected notification " << type; |
607 } | 612 } |
608 #else | 613 #else |
609 // MSVC++ warns about switch statements without any cases. | 614 // MSVC++ warns about switch statements without any cases. |
610 NOTREACHED() << "Unexpected notification " << type; | 615 NOTREACHED() << "Unexpected notification " << type; |
611 #endif | 616 #endif |
612 } | 617 } |
OLD | NEW |