| 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/first_run/first_run.h" | 5 #include "chrome/browser/first_run/first_run.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 delete install_prefs; | 456 delete install_prefs; |
| 457 return NULL; | 457 return NULL; |
| 458 } | 458 } |
| 459 | 459 |
| 460 return install_prefs; | 460 return install_prefs; |
| 461 } | 461 } |
| 462 | 462 |
| 463 // Makes chrome the user's default browser according to policy or | 463 // Makes chrome the user's default browser according to policy or |
| 464 // |make_chrome_default_for_user| if no policy is set. | 464 // |make_chrome_default_for_user| if no policy is set. |
| 465 void ProcessDefaultBrowserPolicy(bool make_chrome_default_for_user) { | 465 void ProcessDefaultBrowserPolicy(bool make_chrome_default_for_user) { |
| 466 // Only proceed if chrome can be made default unattended. The interactive case | 466 // Only proceed if chrome can be made default unattended. In other cases, this |
| 467 // (Windows 8+) is handled by the first run default browser prompt. | 467 // is handled by the first run default browser prompt (on Windows 8+). |
| 468 if (shell_integration::CanSetAsDefaultBrowser() == | 468 if (shell_integration::GetDefaultWebClientSetPermission() == |
| 469 shell_integration::SET_DEFAULT_UNATTENDED) { | 469 shell_integration::SET_DEFAULT_UNATTENDED) { |
| 470 // The policy has precedence over the user's choice. | 470 // The policy has precedence over the user's choice. |
| 471 if (g_browser_process->local_state()->IsManagedPreference( | 471 if (g_browser_process->local_state()->IsManagedPreference( |
| 472 prefs::kDefaultBrowserSettingEnabled)) { | 472 prefs::kDefaultBrowserSettingEnabled)) { |
| 473 if (g_browser_process->local_state()->GetBoolean( | 473 if (g_browser_process->local_state()->GetBoolean( |
| 474 prefs::kDefaultBrowserSettingEnabled)) { | 474 prefs::kDefaultBrowserSettingEnabled)) { |
| 475 shell_integration::SetAsDefaultBrowser(); | 475 shell_integration::SetAsDefaultBrowser(); |
| 476 } | 476 } |
| 477 } else if (make_chrome_default_for_user) { | 477 } else if (make_chrome_default_for_user) { |
| 478 shell_integration::SetAsDefaultBrowser(); | 478 shell_integration::SetAsDefaultBrowser(); |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 SetShouldDoPersonalDataManagerFirstRun(); | 843 SetShouldDoPersonalDataManagerFirstRun(); |
| 844 | 844 |
| 845 internal::DoPostImportPlatformSpecificTasks(profile); | 845 internal::DoPostImportPlatformSpecificTasks(profile); |
| 846 } | 846 } |
| 847 | 847 |
| 848 uint16_t auto_import_state() { | 848 uint16_t auto_import_state() { |
| 849 return g_auto_import_state; | 849 return g_auto_import_state; |
| 850 } | 850 } |
| 851 | 851 |
| 852 } // namespace first_run | 852 } // namespace first_run |
| OLD | NEW |