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()) { | |
Mr4D (OOO till 08-26)
2013/01/30 04:05:27
No brackets needed
zel
2013/01/30 17:06:43
Done.
| |
590 return NULL; | |
591 } | |
592 | |
587 return new LauncherContextMenu(launcher_delegate_, root); | 593 return new LauncherContextMenu(launcher_delegate_, root); |
588 } | 594 } |
589 | 595 |
590 ash::RootWindowHostFactory* ChromeShellDelegate::CreateRootWindowHostFactory() { | 596 ash::RootWindowHostFactory* ChromeShellDelegate::CreateRootWindowHostFactory() { |
591 return ash::RootWindowHostFactory::Create(); | 597 return ash::RootWindowHostFactory::Create(); |
592 } | 598 } |
593 | 599 |
594 void ChromeShellDelegate::Observe(int type, | 600 void ChromeShellDelegate::Observe(int type, |
595 const content::NotificationSource& source, | 601 const content::NotificationSource& source, |
596 const content::NotificationDetails& details) { | 602 const content::NotificationDetails& details) { |
597 #if defined(OS_CHROMEOS) | 603 #if defined(OS_CHROMEOS) |
598 switch (type) { | 604 switch (type) { |
599 case chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED: | 605 case chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED: |
600 ash::Shell::GetInstance()->CreateLauncher(); | 606 ash::Shell::GetInstance()->CreateLauncher(); |
601 break; | 607 break; |
602 case chrome::NOTIFICATION_SESSION_STARTED: | 608 case chrome::NOTIFICATION_SESSION_STARTED: |
603 ash::Shell::GetInstance()->ShowLauncher(); | 609 ash::Shell::GetInstance()->ShowLauncher(); |
604 break; | 610 break; |
605 default: | 611 default: |
606 NOTREACHED() << "Unexpected notification " << type; | 612 NOTREACHED() << "Unexpected notification " << type; |
607 } | 613 } |
608 #else | 614 #else |
609 // MSVC++ warns about switch statements without any cases. | 615 // MSVC++ warns about switch statements without any cases. |
610 NOTREACHED() << "Unexpected notification " << type; | 616 NOTREACHED() << "Unexpected notification " << type; |
611 #endif | 617 #endif |
612 } | 618 } |
OLD | NEW |