Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: chrome/browser/ui/ash/launcher/launcher_context_menu.cc

Issue 93883004: Sync the launch type pref for apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unfix nit because it prevents testing of how invalid values are handled Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/metrics/user_metrics_recorder.h" 10 #include "ash/metrics/user_metrics_recorder.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 if (item_.type == ash::TYPE_PLATFORM_APP) { 175 if (item_.type == ash::TYPE_PLATFORM_APP) {
176 return l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_NEW_WINDOW); 176 return l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_NEW_WINDOW);
177 } 177 }
178 switch (controller_->GetLaunchType(item_.id)) { 178 switch (controller_->GetLaunchType(item_.id)) {
179 case extensions::LAUNCH_TYPE_PINNED: 179 case extensions::LAUNCH_TYPE_PINNED:
180 case extensions::LAUNCH_TYPE_REGULAR: 180 case extensions::LAUNCH_TYPE_REGULAR:
181 return l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_NEW_TAB); 181 return l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_NEW_TAB);
182 case extensions::LAUNCH_TYPE_FULLSCREEN: 182 case extensions::LAUNCH_TYPE_FULLSCREEN:
183 case extensions::LAUNCH_TYPE_WINDOW: 183 case extensions::LAUNCH_TYPE_WINDOW:
184 return l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_NEW_WINDOW); 184 return l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_NEW_WINDOW);
185 default:
186 NOTREACHED();
187 return base::string16();
185 } 188 }
186 } 189 }
187 NOTREACHED(); 190 NOTREACHED();
188 return base::string16(); 191 return base::string16();
189 } 192 }
190 193
191 bool LauncherContextMenu::IsCommandIdChecked(int command_id) const { 194 bool LauncherContextMenu::IsCommandIdChecked(int command_id) const {
192 switch (command_id) { 195 switch (command_id) {
193 case LAUNCH_TYPE_PINNED_TAB: 196 case LAUNCH_TYPE_PINNED_TAB:
194 return controller_->GetLaunchType(item_.id) == 197 return controller_->GetLaunchType(item_.id) ==
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 case MENU_CHANGE_WALLPAPER: 295 case MENU_CHANGE_WALLPAPER:
293 ash::Shell::GetInstance()->user_wallpaper_delegate()-> 296 ash::Shell::GetInstance()->user_wallpaper_delegate()->
294 OpenSetWallpaperPage(); 297 OpenSetWallpaperPage();
295 break; 298 break;
296 #endif 299 #endif
297 default: 300 default:
298 extension_items_->ExecuteCommand(command_id, NULL, 301 extension_items_->ExecuteCommand(command_id, NULL,
299 content::ContextMenuParams()); 302 content::ContextMenuParams());
300 } 303 }
301 } 304 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698