| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #include "chrome/browser/profiles/profile_attributes_storage.h" | 49 #include "chrome/browser/profiles/profile_attributes_storage.h" |
| 50 #include "chrome/browser/profiles/profile_manager.h" | 50 #include "chrome/browser/profiles/profile_manager.h" |
| 51 #include "chrome/browser/profiles/profiles_state.h" | 51 #include "chrome/browser/profiles/profiles_state.h" |
| 52 #include "chrome/browser/search_engines/template_url_service_factory.h" | 52 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 53 #include "chrome/browser/ui/browser.h" | 53 #include "chrome/browser/ui/browser.h" |
| 54 #include "chrome/browser/ui/browser_dialogs.h" | 54 #include "chrome/browser/ui/browser_dialogs.h" |
| 55 #include "chrome/browser/ui/browser_finder.h" | 55 #include "chrome/browser/ui/browser_finder.h" |
| 56 #include "chrome/browser/ui/browser_window.h" | 56 #include "chrome/browser/ui/browser_window.h" |
| 57 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" | 57 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" |
| 58 #include "chrome/browser/ui/user_manager.h" | 58 #include "chrome/browser/ui/user_manager.h" |
| 59 #include "chrome/browser/ui/webui/options/reset_profile_settings_handler.h" | 59 #include "chrome/browser/ui/webui/settings/reset_settings_handler.h" |
| 60 #include "chrome/common/chrome_constants.h" | 60 #include "chrome/common/chrome_constants.h" |
| 61 #include "chrome/common/chrome_paths.h" | 61 #include "chrome/common/chrome_paths.h" |
| 62 #include "chrome/common/chrome_result_codes.h" | 62 #include "chrome/common/chrome_result_codes.h" |
| 63 #include "chrome/common/chrome_switches.h" | 63 #include "chrome/common/chrome_switches.h" |
| 64 #include "chrome/common/pref_names.h" | 64 #include "chrome/common/pref_names.h" |
| 65 #include "chrome/common/url_constants.h" | 65 #include "chrome/common/url_constants.h" |
| 66 #include "chrome/installer/util/browser_distribution.h" | 66 #include "chrome/installer/util/browser_distribution.h" |
| 67 #include "components/google/core/browser/google_util.h" | 67 #include "components/google/core/browser/google_util.h" |
| 68 #include "components/prefs/pref_registry_simple.h" | 68 #include "components/prefs/pref_registry_simple.h" |
| 69 #include "components/prefs/pref_service.h" | 69 #include "components/prefs/pref_service.h" |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 #else | 531 #else |
| 532 // Exposed for external cleaners to offer a settings reset to the | 532 // Exposed for external cleaners to offer a settings reset to the |
| 533 // user. The allowed URLs must match exactly. | 533 // user. The allowed URLs must match exactly. |
| 534 const GURL reset_settings_url = | 534 const GURL reset_settings_url = |
| 535 settings_url.Resolve(chrome::kResetProfileSettingsSubPage); | 535 settings_url.Resolve(chrome::kResetProfileSettingsSubPage); |
| 536 url_points_to_an_approved_settings_page = url == reset_settings_url; | 536 url_points_to_an_approved_settings_page = url == reset_settings_url; |
| 537 #if defined(OS_WIN) | 537 #if defined(OS_WIN) |
| 538 // On Windows, also allow a hash for the Chrome Cleanup Tool. | 538 // On Windows, also allow a hash for the Chrome Cleanup Tool. |
| 539 const GURL reset_settings_url_with_cct_hash = reset_settings_url.Resolve( | 539 const GURL reset_settings_url_with_cct_hash = reset_settings_url.Resolve( |
| 540 std::string("#") + | 540 std::string("#") + |
| 541 options::ResetProfileSettingsHandler::kCctResetSettingsHash); | 541 settings::ResetSettingsHandler::kCctResetSettingsHash); |
| 542 url_points_to_an_approved_settings_page = | 542 url_points_to_an_approved_settings_page = |
| 543 url_points_to_an_approved_settings_page || | 543 url_points_to_an_approved_settings_page || |
| 544 url == reset_settings_url_with_cct_hash; | 544 url == reset_settings_url_with_cct_hash; |
| 545 #endif // defined(OS_WIN) | 545 #endif // defined(OS_WIN) |
| 546 #endif // defined(OS_CHROMEOS) | 546 #endif // defined(OS_CHROMEOS) |
| 547 | 547 |
| 548 ChildProcessSecurityPolicy* policy = | 548 ChildProcessSecurityPolicy* policy = |
| 549 ChildProcessSecurityPolicy::GetInstance(); | 549 ChildProcessSecurityPolicy::GetInstance(); |
| 550 if (policy->IsWebSafeScheme(url.scheme()) || | 550 if (policy->IsWebSafeScheme(url.scheme()) || |
| 551 url.SchemeIs(url::kFileScheme) || | 551 url.SchemeIs(url::kFileScheme) || |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 if (!entry->IsSigninRequired()) { | 947 if (!entry->IsSigninRequired()) { |
| 948 Profile* profile = profile_manager->GetProfile(entry->GetPath()); | 948 Profile* profile = profile_manager->GetProfile(entry->GetPath()); |
| 949 if (profile) | 949 if (profile) |
| 950 return profile; | 950 return profile; |
| 951 } | 951 } |
| 952 } | 952 } |
| 953 | 953 |
| 954 return nullptr; | 954 return nullptr; |
| 955 } | 955 } |
| 956 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) | 956 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) |
| OLD | NEW |