| 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/launcher/launcher_context_menu.h" | 5 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "ash/desktop_background/user_wallpaper_delegate.h" | 9 #include "ash/desktop_background/user_wallpaper_delegate.h" |
| 10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
| 11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 12 #include "ash/shell_delegate.h" | 12 #include "ash/shell_delegate.h" |
| 13 #include "ash/wm/property_util.h" | 13 #include "ash/wm/property_util.h" |
| 14 #include "base/bind.h" | 14 #include "base/bind.h" |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "base/prefs/pref_service.h" | 16 #include "base/prefs/pref_service.h" |
| 17 #include "chrome/browser/extensions/context_menu_matcher.h" | 17 #include "chrome/browser/extensions/context_menu_matcher.h" |
| 18 #include "chrome/browser/extensions/extension_prefs.h" | 18 #include "chrome/browser/extensions/extension_prefs.h" |
| 19 #include "chrome/browser/fullscreen.h" |
| 19 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 20 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 20 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
| 21 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" | 22 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
| 22 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 23 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 23 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
| 24 #include "content/public/common/context_menu_params.h" | 25 #include "content/public/common/context_menu_params.h" |
| 25 #include "grit/ash_strings.h" | 26 #include "grit/ash_strings.h" |
| 26 #include "grit/generated_resources.h" | 27 #include "grit/generated_resources.h" |
| 27 #include "ui/base/l10n/l10n_util.h" | 28 #include "ui/base/l10n/l10n_util.h" |
| 28 | 29 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 item_.type == ash::TYPE_PLATFORM_APP) { | 128 item_.type == ash::TYPE_PLATFORM_APP) { |
| 128 std::string app_id = controller_->GetAppIDForLauncherID(item_.id); | 129 std::string app_id = controller_->GetAppIDForLauncherID(item_.id); |
| 129 if (!app_id.empty()) { | 130 if (!app_id.empty()) { |
| 130 int index = 0; | 131 int index = 0; |
| 131 extension_items_->AppendExtensionItems( | 132 extension_items_->AppendExtensionItems( |
| 132 app_id, string16(), &index); | 133 app_id, string16(), &index); |
| 133 AddSeparator(ui::NORMAL_SEPARATOR); | 134 AddSeparator(ui::NORMAL_SEPARATOR); |
| 134 } | 135 } |
| 135 } | 136 } |
| 136 } | 137 } |
| 137 // Don't show the auto-hide menu item while in immersive mode because the | 138 // In fullscreen, the launcher is either hidden or autohidden depending on |
| 138 // launcher always auto-hides in this mode and it's confusing when the | 139 // the type of fullscreen. Do not show the auto-hide menu item while in |
| 139 // preference appears not to apply. | 140 // fullscreen because it is confusing when the preference appears not to |
| 140 ash::internal::RootWindowController* root_window_controller = | 141 // apply. |
| 141 ash::GetRootWindowController(root_window_); | 142 if (!IsFullScreenMode()) { |
| 142 if (root_window_controller != NULL && | |
| 143 !root_window_controller->IsImmersiveMode()) { | |
| 144 AddCheckItemWithStringId( | 143 AddCheckItemWithStringId( |
| 145 MENU_AUTO_HIDE, IDS_AURA_LAUNCHER_CONTEXT_MENU_AUTO_HIDE); | 144 MENU_AUTO_HIDE, IDS_AURA_LAUNCHER_CONTEXT_MENU_AUTO_HIDE); |
| 146 } | 145 } |
| 147 if (CommandLine::ForCurrentProcess()->HasSwitch( | 146 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 148 switches::kShowLauncherAlignmentMenu)) { | 147 switches::kShowLauncherAlignmentMenu)) { |
| 149 AddSubMenuWithStringId(MENU_ALIGNMENT_MENU, | 148 AddSubMenuWithStringId(MENU_ALIGNMENT_MENU, |
| 150 IDS_AURA_LAUNCHER_CONTEXT_MENU_POSITION, | 149 IDS_AURA_LAUNCHER_CONTEXT_MENU_POSITION, |
| 151 &launcher_alignment_menu_); | 150 &launcher_alignment_menu_); |
| 152 } | 151 } |
| 153 #if defined(OS_CHROMEOS) | 152 #if defined(OS_CHROMEOS) |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 case MENU_CHANGE_WALLPAPER: | 277 case MENU_CHANGE_WALLPAPER: |
| 279 ash::Shell::GetInstance()->user_wallpaper_delegate()-> | 278 ash::Shell::GetInstance()->user_wallpaper_delegate()-> |
| 280 OpenSetWallpaperPage(); | 279 OpenSetWallpaperPage(); |
| 281 break; | 280 break; |
| 282 #endif | 281 #endif |
| 283 default: | 282 default: |
| 284 extension_items_->ExecuteCommand(command_id, NULL, | 283 extension_items_->ExecuteCommand(command_id, NULL, |
| 285 content::ContextMenuParams()); | 284 content::ContextMenuParams()); |
| 286 } | 285 } |
| 287 } | 286 } |
| OLD | NEW |