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