| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> // For max(). | 9 #include <algorithm> // For max(). |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 #include "components/prefs/pref_service.h" | 70 #include "components/prefs/pref_service.h" |
| 71 #include "components/search_engines/util.h" | 71 #include "components/search_engines/util.h" |
| 72 #include "components/signin/core/common/profile_management_switches.h" | 72 #include "components/signin/core/common/profile_management_switches.h" |
| 73 #include "components/url_formatter/url_fixer.h" | 73 #include "components/url_formatter/url_fixer.h" |
| 74 #include "content/public/browser/browser_thread.h" | 74 #include "content/public/browser/browser_thread.h" |
| 75 #include "content/public/browser/child_process_security_policy.h" | 75 #include "content/public/browser/child_process_security_policy.h" |
| 76 #include "content/public/browser/navigation_controller.h" | 76 #include "content/public/browser/navigation_controller.h" |
| 77 #include "content/public/common/content_switches.h" | 77 #include "content/public/common/content_switches.h" |
| 78 #include "extensions/common/switches.h" | 78 #include "extensions/common/switches.h" |
| 79 #include "net/base/port_util.h" | 79 #include "net/base/port_util.h" |
| 80 #include "printing/features/features.h" |
| 80 | 81 |
| 81 #if defined(USE_ASH) | 82 #if defined(USE_ASH) |
| 82 #include "ash/shell.h" // nogncheck | 83 #include "ash/shell.h" // nogncheck |
| 83 #endif | 84 #endif |
| 84 | 85 |
| 85 #if defined(OS_CHROMEOS) | 86 #if defined(OS_CHROMEOS) |
| 86 #include "chrome/browser/chromeos/app_mode/app_launch_utils.h" | 87 #include "chrome/browser/chromeos/app_mode/app_launch_utils.h" |
| 87 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" | 88 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" |
| 88 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 89 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 89 #include "chrome/browser/lifetime/application_lifetime.h" | 90 #include "chrome/browser/lifetime/application_lifetime.h" |
| 90 #include "chromeos/chromeos_switches.h" | 91 #include "chromeos/chromeos_switches.h" |
| 91 #include "chromeos/cryptohome/cryptohome_parameters.h" | 92 #include "chromeos/cryptohome/cryptohome_parameters.h" |
| 92 #include "components/user_manager/user_manager.h" | 93 #include "components/user_manager/user_manager.h" |
| 93 #endif | 94 #endif |
| 94 | 95 |
| 95 #if defined(TOOLKIT_VIEWS) && defined(OS_LINUX) | 96 #if defined(TOOLKIT_VIEWS) && defined(OS_LINUX) |
| 96 #include "ui/events/devices/x11/touch_factory_x11.h" // nogncheck | 97 #include "ui/events/devices/x11/touch_factory_x11.h" // nogncheck |
| 97 #endif | 98 #endif |
| 98 | 99 |
| 99 #if defined(OS_MACOSX) | 100 #if defined(OS_MACOSX) |
| 100 #include "chrome/browser/web_applications/web_app_mac.h" | 101 #include "chrome/browser/web_applications/web_app_mac.h" |
| 101 #endif | 102 #endif |
| 102 | 103 |
| 103 #if defined(OS_WIN) | 104 #if defined(OS_WIN) |
| 104 #include "chrome/browser/metrics/jumplist_metrics_win.h" | 105 #include "chrome/browser/metrics/jumplist_metrics_win.h" |
| 105 #endif | 106 #endif |
| 106 | 107 |
| 107 #if defined(ENABLE_PRINT_PREVIEW) | 108 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 108 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" | 109 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" |
| 109 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.
h" | 110 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.
h" |
| 110 #include "chrome/browser/printing/print_dialog_cloud.h" | 111 #include "chrome/browser/printing/print_dialog_cloud.h" |
| 111 #endif | 112 #endif |
| 112 | 113 |
| 113 #if BUILDFLAG(ENABLE_APP_LIST) | 114 #if BUILDFLAG(ENABLE_APP_LIST) |
| 114 #include "chrome/browser/ui/app_list/app_list_service.h" | 115 #include "chrome/browser/ui/app_list/app_list_service.h" |
| 115 #endif | 116 #endif |
| 116 | 117 |
| 117 using content::BrowserThread; | 118 using content::BrowserThread; |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 TRACE_EVENT0("startup", "StartupBrowserCreator::ProcessCmdLineImpl"); | 571 TRACE_EVENT0("startup", "StartupBrowserCreator::ProcessCmdLineImpl"); |
| 571 | 572 |
| 572 DCHECK(last_used_profile); | 573 DCHECK(last_used_profile); |
| 573 if (process_startup) { | 574 if (process_startup) { |
| 574 if (command_line.HasSwitch(switches::kDisablePromptOnRepost)) | 575 if (command_line.HasSwitch(switches::kDisablePromptOnRepost)) |
| 575 content::NavigationController::DisablePromptOnRepost(); | 576 content::NavigationController::DisablePromptOnRepost(); |
| 576 } | 577 } |
| 577 | 578 |
| 578 bool silent_launch = false; | 579 bool silent_launch = false; |
| 579 | 580 |
| 580 #if defined(ENABLE_PRINT_PREVIEW) | 581 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 581 // If we are just displaying a print dialog we shouldn't open browser | 582 // If we are just displaying a print dialog we shouldn't open browser |
| 582 // windows. | 583 // windows. |
| 583 if (command_line.HasSwitch(switches::kCloudPrintFile) && | 584 if (command_line.HasSwitch(switches::kCloudPrintFile) && |
| 584 print_dialog_cloud::CreatePrintDialogFromCommandLine(last_used_profile, | 585 print_dialog_cloud::CreatePrintDialogFromCommandLine(last_used_profile, |
| 585 command_line)) { | 586 command_line)) { |
| 586 silent_launch = true; | 587 silent_launch = true; |
| 587 } | 588 } |
| 588 #endif // defined(ENABLE_PRINT_PREVIEW) | 589 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 589 | 590 |
| 590 if (command_line.HasSwitch(switches::kExplicitlyAllowedPorts)) { | 591 if (command_line.HasSwitch(switches::kExplicitlyAllowedPorts)) { |
| 591 std::string allowed_ports = | 592 std::string allowed_ports = |
| 592 command_line.GetSwitchValueASCII(switches::kExplicitlyAllowedPorts); | 593 command_line.GetSwitchValueASCII(switches::kExplicitlyAllowedPorts); |
| 593 net::SetExplicitlyAllowedPorts(allowed_ports); | 594 net::SetExplicitlyAllowedPorts(allowed_ports); |
| 594 } | 595 } |
| 595 | 596 |
| 596 if (command_line.HasSwitch(switches::kValidateCrx)) { | 597 if (command_line.HasSwitch(switches::kValidateCrx)) { |
| 597 if (!process_startup) { | 598 if (!process_startup) { |
| 598 LOG(ERROR) << "chrome is already running; you must close all running " | 599 LOG(ERROR) << "chrome is already running; you must close all running " |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 950 if (!entry->IsSigninRequired()) { | 951 if (!entry->IsSigninRequired()) { |
| 951 Profile* profile = profile_manager->GetProfile(entry->GetPath()); | 952 Profile* profile = profile_manager->GetProfile(entry->GetPath()); |
| 952 if (profile) | 953 if (profile) |
| 953 return profile; | 954 return profile; |
| 954 } | 955 } |
| 955 } | 956 } |
| 956 | 957 |
| 957 return nullptr; | 958 return nullptr; |
| 958 } | 959 } |
| 959 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) | 960 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) |
| OLD | NEW |