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" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 AddItem( | 79 AddItem( |
80 MENU_PIN, | 80 MENU_PIN, |
81 l10n_util::GetStringUTF16(controller_->IsPinned(item_.id) ? | 81 l10n_util::GetStringUTF16(controller_->IsPinned(item_.id) ? |
82 IDS_LAUNCHER_CONTEXT_MENU_UNPIN : | 82 IDS_LAUNCHER_CONTEXT_MENU_UNPIN : |
83 IDS_LAUNCHER_CONTEXT_MENU_PIN)); | 83 IDS_LAUNCHER_CONTEXT_MENU_PIN)); |
84 if (controller_->IsOpen(item_.id)) { | 84 if (controller_->IsOpen(item_.id)) { |
85 AddItem(MENU_CLOSE, | 85 AddItem(MENU_CLOSE, |
86 l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_CLOSE)); | 86 l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_CLOSE)); |
87 } | 87 } |
88 if (!controller_->IsPlatformApp(item_.id) && | 88 if (!controller_->IsPlatformApp(item_.id) && |
89 item_.type != ash::TYPE_WINDOWED_APP) { | 89 item_.type != ash::TYPE_WINDOWED_APP && |
90 !ash::Shell::IsForcedMaximizeMode()) { | |
James Cook
2013/04/22 22:15:46
Don't you want to do this below, not here?
Mr4D (OOO till 08-26)
2013/04/23 04:41:28
Good catch! There was a fore and back on this one.
| |
90 AddSeparator(ui::NORMAL_SEPARATOR); | 91 AddSeparator(ui::NORMAL_SEPARATOR); |
91 AddCheckItemWithStringId( | 92 AddCheckItemWithStringId( |
92 LAUNCH_TYPE_REGULAR_TAB, | 93 LAUNCH_TYPE_REGULAR_TAB, |
93 IDS_APP_CONTEXT_MENU_OPEN_REGULAR); | 94 IDS_APP_CONTEXT_MENU_OPEN_REGULAR); |
94 AddCheckItemWithStringId( | 95 AddCheckItemWithStringId( |
95 LAUNCH_TYPE_PINNED_TAB, | 96 LAUNCH_TYPE_PINNED_TAB, |
96 IDS_APP_CONTEXT_MENU_OPEN_PINNED); | 97 IDS_APP_CONTEXT_MENU_OPEN_PINNED); |
97 AddCheckItemWithStringId( | 98 if (!ash::Shell::IsForcedMaximizeMode()) { |
98 LAUNCH_TYPE_WINDOW, | 99 AddCheckItemWithStringId( |
99 IDS_APP_CONTEXT_MENU_OPEN_WINDOW); | 100 LAUNCH_TYPE_WINDOW, |
100 // Even though the launch type is Full Screen it is more accurately | 101 IDS_APP_CONTEXT_MENU_OPEN_WINDOW); |
101 // described as Maximized in Ash. | 102 // Even though the launch type is Full Screen it is more accurately |
102 AddCheckItemWithStringId( | 103 // described as Maximized in Ash. |
103 LAUNCH_TYPE_FULLSCREEN, | 104 AddCheckItemWithStringId( |
104 IDS_APP_CONTEXT_MENU_OPEN_MAXIMIZED); | 105 LAUNCH_TYPE_FULLSCREEN, |
106 IDS_APP_CONTEXT_MENU_OPEN_MAXIMIZED); | |
107 } | |
105 } | 108 } |
106 } else if (item_.type == ash::TYPE_BROWSER_SHORTCUT) { | 109 } else if (item_.type == ash::TYPE_BROWSER_SHORTCUT) { |
107 AddItem(MENU_NEW_WINDOW, | 110 AddItem(MENU_NEW_WINDOW, |
108 l10n_util::GetStringUTF16(IDS_LAUNCHER_NEW_WINDOW)); | 111 l10n_util::GetStringUTF16(IDS_LAUNCHER_NEW_WINDOW)); |
109 if (!controller_->IsLoggedInAsGuest()) { | 112 if (!controller_->IsLoggedInAsGuest()) { |
110 AddItem(MENU_NEW_INCOGNITO_WINDOW, | 113 AddItem(MENU_NEW_INCOGNITO_WINDOW, |
111 l10n_util::GetStringUTF16(IDS_LAUNCHER_NEW_INCOGNITO_WINDOW)); | 114 l10n_util::GetStringUTF16(IDS_LAUNCHER_NEW_INCOGNITO_WINDOW)); |
112 } | 115 } |
113 } else { | 116 } else { |
114 if (item_.type == ash::TYPE_PLATFORM_APP) { | 117 if (item_.type == ash::TYPE_PLATFORM_APP) { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
278 case MENU_CHANGE_WALLPAPER: | 281 case MENU_CHANGE_WALLPAPER: |
279 ash::Shell::GetInstance()->user_wallpaper_delegate()-> | 282 ash::Shell::GetInstance()->user_wallpaper_delegate()-> |
280 OpenSetWallpaperPage(); | 283 OpenSetWallpaperPage(); |
281 break; | 284 break; |
282 #endif | 285 #endif |
283 default: | 286 default: |
284 extension_items_->ExecuteCommand(command_id, NULL, | 287 extension_items_->ExecuteCommand(command_id, NULL, |
285 content::ContextMenuParams()); | 288 content::ContextMenuParams()); |
286 } | 289 } |
287 } | 290 } |
OLD | NEW |