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

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator_impl.cc

Issue 489313002: Centralize command line checks for kEnableStreamlinedHostedApps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 3 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 | Annotate | Revision Log
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/startup/startup_browser_creator_impl.h" 5 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "apps/app_restore_service.h" 10 #include "apps/app_restore_service.h"
(...skipping 15 matching lines...) Expand all
26 #include "base/strings/utf_string_conversions.h" 26 #include "base/strings/utf_string_conversions.h"
27 #include "base/threading/thread_restrictions.h" 27 #include "base/threading/thread_restrictions.h"
28 #include "chrome/browser/apps/install_chrome_app.h" 28 #include "chrome/browser/apps/install_chrome_app.h"
29 #include "chrome/browser/auto_launch_trial.h" 29 #include "chrome/browser/auto_launch_trial.h"
30 #include "chrome/browser/browser_process.h" 30 #include "chrome/browser/browser_process.h"
31 #include "chrome/browser/chrome_notification_types.h" 31 #include "chrome/browser/chrome_notification_types.h"
32 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 32 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
33 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" 33 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
34 #include "chrome/browser/defaults.h" 34 #include "chrome/browser/defaults.h"
35 #include "chrome/browser/extensions/extension_creator.h" 35 #include "chrome/browser/extensions/extension_creator.h"
36 #include "chrome/browser/extensions/extension_util.h"
36 #include "chrome/browser/extensions/launch_util.h" 37 #include "chrome/browser/extensions/launch_util.h"
37 #include "chrome/browser/extensions/pack_extension_job.h" 38 #include "chrome/browser/extensions/pack_extension_job.h"
38 #include "chrome/browser/first_run/first_run.h" 39 #include "chrome/browser/first_run/first_run.h"
39 #include "chrome/browser/infobars/infobar_service.h" 40 #include "chrome/browser/infobars/infobar_service.h"
40 #include "chrome/browser/net/predictor.h" 41 #include "chrome/browser/net/predictor.h"
41 #include "chrome/browser/notifications/desktop_notification_service.h" 42 #include "chrome/browser/notifications/desktop_notification_service.h"
42 #include "chrome/browser/performance_monitor/startup_timer.h" 43 #include "chrome/browser/performance_monitor/startup_timer.h"
43 #include "chrome/browser/prefs/incognito_mode_prefs.h" 44 #include "chrome/browser/prefs/incognito_mode_prefs.h"
44 #include "chrome/browser/prefs/session_startup_pref.h" 45 #include "chrome/browser/prefs/session_startup_pref.h"
45 #include "chrome/browser/profiles/profile.h" 46 #include "chrome/browser/profiles/profile.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 195
195 // Don't launch platform apps in incognito mode. 196 // Don't launch platform apps in incognito mode.
196 if (profile->IsOffTheRecord() && extension->is_platform_app()) 197 if (profile->IsOffTheRecord() && extension->is_platform_app())
197 return false; 198 return false;
198 199
199 // Look at preferences to find the right launch container. If no 200 // Look at preferences to find the right launch container. If no
200 // preference is set, launch as a window. 201 // preference is set, launch as a window.
201 extensions::LaunchContainer launch_container = extensions::GetLaunchContainer( 202 extensions::LaunchContainer launch_container = extensions::GetLaunchContainer(
202 extensions::ExtensionPrefs::Get(profile), extension); 203 extensions::ExtensionPrefs::Get(profile), extension);
203 204
204 if (!CommandLine::ForCurrentProcess()->HasSwitch( 205 if (!extensions::util::IsStreamlinedHostedAppsEnabled() &&
205 switches::kEnableStreamlinedHostedApps) &&
206 !extensions::HasPreferredLaunchContainer( 206 !extensions::HasPreferredLaunchContainer(
207 extensions::ExtensionPrefs::Get(profile), extension)) { 207 extensions::ExtensionPrefs::Get(profile), extension)) {
208 launch_container = extensions::LAUNCH_CONTAINER_WINDOW; 208 launch_container = extensions::LAUNCH_CONTAINER_WINDOW;
209 } 209 }
210 210
211 *out_extension = extension; 211 *out_extension = extension;
212 *out_launch_container = launch_container; 212 *out_launch_container = launch_container;
213 return true; 213 return true;
214 } 214 }
215 215
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 // behavior is desired because completing or skipping the sync promo 915 // behavior is desired because completing or skipping the sync promo
916 // causes a redirect to the NTP. 916 // causes a redirect to the NTP.
917 if (!startup_urls->empty() && 917 if (!startup_urls->empty() &&
918 startup_urls->at(0) == GURL(chrome::kChromeUINewTabURL)) 918 startup_urls->at(0) == GURL(chrome::kChromeUINewTabURL))
919 startup_urls->at(0) = sync_promo_url; 919 startup_urls->at(0) = sync_promo_url;
920 else 920 else
921 startup_urls->insert(startup_urls->begin(), sync_promo_url); 921 startup_urls->insert(startup_urls->begin(), sync_promo_url);
922 } 922 }
923 } 923 }
924 } 924 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_command_controller.cc ('k') | chrome/browser/ui/toolbar/wrench_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698