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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 #include "chrome/common/chrome_paths.h" | 56 #include "chrome/common/chrome_paths.h" |
57 #include "chrome/common/chrome_result_codes.h" | 57 #include "chrome/common/chrome_result_codes.h" |
58 #include "chrome/common/chrome_switches.h" | 58 #include "chrome/common/chrome_switches.h" |
59 #include "chrome/common/chrome_version_info.h" | 59 #include "chrome/common/chrome_version_info.h" |
60 #include "chrome/common/pref_names.h" | 60 #include "chrome/common/pref_names.h" |
61 #include "chrome/common/url_constants.h" | 61 #include "chrome/common/url_constants.h" |
62 #include "chrome/installer/util/browser_distribution.h" | 62 #include "chrome/installer/util/browser_distribution.h" |
63 #include "components/google/core/browser/google_util.h" | 63 #include "components/google/core/browser/google_util.h" |
64 #include "components/search_engines/util.h" | 64 #include "components/search_engines/util.h" |
65 #include "components/signin/core/common/profile_management_switches.h" | 65 #include "components/signin/core/common/profile_management_switches.h" |
66 #include "components/url_fixer/url_fixer.h" | 66 #include "components/url_formatter/url_fixer.h" |
67 #include "content/public/browser/browser_thread.h" | 67 #include "content/public/browser/browser_thread.h" |
68 #include "content/public/browser/child_process_security_policy.h" | 68 #include "content/public/browser/child_process_security_policy.h" |
69 #include "content/public/browser/navigation_controller.h" | 69 #include "content/public/browser/navigation_controller.h" |
70 #include "content/public/common/content_switches.h" | 70 #include "content/public/common/content_switches.h" |
71 #include "extensions/common/switches.h" | 71 #include "extensions/common/switches.h" |
72 #include "net/base/port_util.h" | 72 #include "net/base/port_util.h" |
73 | 73 |
74 #if defined(USE_ASH) | 74 #if defined(USE_ASH) |
75 #include "ash/shell.h" | 75 #include "ash/shell.h" |
76 #endif | 76 #endif |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 // This will create a file URL or a regular URL. | 468 // This will create a file URL or a regular URL. |
469 // This call can (in rare circumstances) block the UI thread. | 469 // This call can (in rare circumstances) block the UI thread. |
470 // Allow it until this bug is fixed. | 470 // Allow it until this bug is fixed. |
471 // http://code.google.com/p/chromium/issues/detail?id=60641 | 471 // http://code.google.com/p/chromium/issues/detail?id=60641 |
472 GURL url = GURL(param.MaybeAsASCII()); | 472 GURL url = GURL(param.MaybeAsASCII()); |
473 // http://crbug.com/371030: Only use URLFixerUpper if we don't have a valid | 473 // http://crbug.com/371030: Only use URLFixerUpper if we don't have a valid |
474 // URL, otherwise we will look in the current directory for a file named | 474 // URL, otherwise we will look in the current directory for a file named |
475 // 'about' if the browser was started with a about:foo argument. | 475 // 'about' if the browser was started with a about:foo argument. |
476 if (!url.is_valid()) { | 476 if (!url.is_valid()) { |
477 base::ThreadRestrictions::ScopedAllowIO allow_io; | 477 base::ThreadRestrictions::ScopedAllowIO allow_io; |
478 url = url_fixer::FixupRelativeFile(cur_dir, param); | 478 url = url_formatter::FixupRelativeFile(cur_dir, param); |
479 } | 479 } |
480 // Exclude dangerous schemes. | 480 // Exclude dangerous schemes. |
481 if (url.is_valid()) { | 481 if (url.is_valid()) { |
482 ChildProcessSecurityPolicy* policy = | 482 ChildProcessSecurityPolicy* policy = |
483 ChildProcessSecurityPolicy::GetInstance(); | 483 ChildProcessSecurityPolicy::GetInstance(); |
484 if (policy->IsWebSafeScheme(url.scheme()) || | 484 if (policy->IsWebSafeScheme(url.scheme()) || |
485 url.SchemeIs(url::kFileScheme) || | 485 url.SchemeIs(url::kFileScheme) || |
486 #if defined(OS_CHROMEOS) | 486 #if defined(OS_CHROMEOS) |
487 // In ChromeOS, allow any settings page to be specified on the command | 487 // In ChromeOS, allow any settings page to be specified on the command |
488 // line. See ExistingUserController::OnLoginSuccess. | 488 // line. See ExistingUserController::OnLoginSuccess. |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 // If we are showing the app list then chrome isn't shown so load the app | 860 // If we are showing the app list then chrome isn't shown so load the app |
861 // list's profile rather than chrome's. | 861 // list's profile rather than chrome's. |
862 if (command_line.HasSwitch(switches::kShowAppList)) { | 862 if (command_line.HasSwitch(switches::kShowAppList)) { |
863 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> | 863 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> |
864 GetProfilePath(user_data_dir); | 864 GetProfilePath(user_data_dir); |
865 } | 865 } |
866 | 866 |
867 return g_browser_process->profile_manager()->GetLastUsedProfileDir( | 867 return g_browser_process->profile_manager()->GetLastUsedProfileDir( |
868 user_data_dir); | 868 user_data_dir); |
869 } | 869 } |
OLD | NEW |