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 18 matching lines...) Expand all Loading... |
29 #include "chrome/browser/ui/ash/window_positioner.h" | 29 #include "chrome/browser/ui/ash/window_positioner.h" |
30 #include "chrome/browser/ui/browser.h" | 30 #include "chrome/browser/ui/browser.h" |
31 #include "chrome/browser/ui/browser_commands.h" | 31 #include "chrome/browser/ui/browser_commands.h" |
32 #include "chrome/browser/ui/browser_finder.h" | 32 #include "chrome/browser/ui/browser_finder.h" |
33 #include "chrome/browser/ui/browser_window.h" | 33 #include "chrome/browser/ui/browser_window.h" |
34 #include "chrome/browser/ui/host_desktop.h" | 34 #include "chrome/browser/ui/host_desktop.h" |
35 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h" | 35 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h" |
36 #include "chrome/common/chrome_notification_types.h" | 36 #include "chrome/common/chrome_notification_types.h" |
37 #include "chrome/common/chrome_switches.h" | 37 #include "chrome/common/chrome_switches.h" |
38 #include "chrome/common/pref_names.h" | 38 #include "chrome/common/pref_names.h" |
| 39 #include "chrome/common/switch_utils.h" |
39 #include "chrome/common/time_format.h" | 40 #include "chrome/common/time_format.h" |
40 #include "chrome/common/url_constants.h" | 41 #include "chrome/common/url_constants.h" |
41 #include "content/public/browser/notification_service.h" | 42 #include "content/public/browser/notification_service.h" |
42 #include "content/public/browser/user_metrics.h" | 43 #include "content/public/browser/user_metrics.h" |
43 #include "content/public/browser/web_contents.h" | 44 #include "content/public/browser/web_contents.h" |
44 #include "grit/generated_resources.h" | 45 #include "grit/generated_resources.h" |
45 #include "ui/aura/client/user_action_client.h" | 46 #include "ui/aura/client/user_action_client.h" |
46 #include "ui/aura/window.h" | 47 #include "ui/aura/window.h" |
47 | 48 |
48 #if defined(OS_CHROMEOS) | 49 #if defined(OS_CHROMEOS) |
(...skipping 528 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 (switches::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 |