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/startup/startup_browser_creator.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
6 | 6 |
7 #include <algorithm> // For max(). | 7 #include <algorithm> // For max(). |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "apps/app_load_service.h" | 10 #include "apps/app_load_service.h" |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 bool silent_launch = false; | 506 bool silent_launch = false; |
507 | 507 |
508 #if defined(ENABLE_PRINT_PREVIEW) | 508 #if defined(ENABLE_PRINT_PREVIEW) |
509 // If we are just displaying a print dialog we shouldn't open browser | 509 // If we are just displaying a print dialog we shouldn't open browser |
510 // windows. | 510 // windows. |
511 if (command_line.HasSwitch(switches::kCloudPrintFile) && | 511 if (command_line.HasSwitch(switches::kCloudPrintFile) && |
512 print_dialog_cloud::CreatePrintDialogFromCommandLine(last_used_profile, | 512 print_dialog_cloud::CreatePrintDialogFromCommandLine(last_used_profile, |
513 command_line)) { | 513 command_line)) { |
514 silent_launch = true; | 514 silent_launch = true; |
515 } | 515 } |
516 | |
517 // If we are checking the proxy enabled policy, don't open any windows. | |
518 if (command_line.HasSwitch(switches::kCheckCloudPrintConnectorPolicy)) { | |
519 silent_launch = true; | |
520 if (CloudPrintProxyServiceFactory::GetForProfile(last_used_profile)-> | |
521 EnforceCloudPrintConnectorPolicyAndQuit()) | |
522 // Success, nothing more needs to be done, so return false to stop | |
523 // launching and quit. | |
524 return false; | |
525 } | |
526 #endif // defined(ENABLE_PRINT_PREVIEW) | 516 #endif // defined(ENABLE_PRINT_PREVIEW) |
527 | 517 |
528 VLOG(2) << "ProcessCmdLineImpl: PLACE 1"; | 518 VLOG(2) << "ProcessCmdLineImpl: PLACE 1"; |
529 if (command_line.HasSwitch(switches::kExplicitlyAllowedPorts)) { | 519 if (command_line.HasSwitch(switches::kExplicitlyAllowedPorts)) { |
530 std::string allowed_ports = | 520 std::string allowed_ports = |
531 command_line.GetSwitchValueASCII(switches::kExplicitlyAllowedPorts); | 521 command_line.GetSwitchValueASCII(switches::kExplicitlyAllowedPorts); |
532 net::SetExplicitlyAllowedPorts(allowed_ports); | 522 net::SetExplicitlyAllowedPorts(allowed_ports); |
533 } | 523 } |
534 | 524 |
535 if (command_line.HasSwitch(switches::kInstallEphemeralAppFromWebstore)) { | 525 if (command_line.HasSwitch(switches::kInstallEphemeralAppFromWebstore)) { |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 // If we are showing the app list then chrome isn't shown so load the app | 846 // If we are showing the app list then chrome isn't shown so load the app |
857 // list's profile rather than chrome's. | 847 // list's profile rather than chrome's. |
858 if (command_line.HasSwitch(switches::kShowAppList)) { | 848 if (command_line.HasSwitch(switches::kShowAppList)) { |
859 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> | 849 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> |
860 GetProfilePath(user_data_dir); | 850 GetProfilePath(user_data_dir); |
861 } | 851 } |
862 | 852 |
863 return g_browser_process->profile_manager()->GetLastUsedProfileDir( | 853 return g_browser_process->profile_manager()->GetLastUsedProfileDir( |
864 user_data_dir); | 854 user_data_dir); |
865 } | 855 } |
OLD | NEW |