| 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/browser_process_impl.h" | 5 #include "chrome/browser/browser_process_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "apps/pref_names.h" |
| 12 #include "base/bind.h" | 13 #include "base/bind.h" |
| 13 #include "base/bind_helpers.h" | 14 #include "base/bind_helpers.h" |
| 14 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 15 #include "base/debug/alias.h" | 16 #include "base/debug/alias.h" |
| 16 #include "base/file_util.h" | 17 #include "base/file_util.h" |
| 17 #include "base/path_service.h" | 18 #include "base/path_service.h" |
| 18 #include "base/prefs/json_pref_store.h" | 19 #include "base/prefs/json_pref_store.h" |
| 19 #include "base/prefs/pref_registry_simple.h" | 20 #include "base/prefs/pref_registry_simple.h" |
| 20 #include "base/prefs/pref_service.h" | 21 #include "base/prefs/pref_service.h" |
| 21 #include "base/synchronization/waitable_event.h" | 22 #include "base/synchronization/waitable_event.h" |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 net::HttpNetworkSession::NORMAL_SOCKET_POOL, | 841 net::HttpNetworkSession::NORMAL_SOCKET_POOL, |
| 841 std::max(std::min(max_per_proxy, 99), | 842 std::max(std::min(max_per_proxy, 99), |
| 842 net::ClientSocketPoolManager::max_sockets_per_group( | 843 net::ClientSocketPoolManager::max_sockets_per_group( |
| 843 net::HttpNetworkSession::NORMAL_SOCKET_POOL))); | 844 net::HttpNetworkSession::NORMAL_SOCKET_POOL))); |
| 844 | 845 |
| 845 pref_change_registrar_.Add( | 846 pref_change_registrar_.Add( |
| 846 prefs::kDisabledSchemes, | 847 prefs::kDisabledSchemes, |
| 847 base::Bind(&BrowserProcessImpl::ApplyDisabledSchemesPolicy, | 848 base::Bind(&BrowserProcessImpl::ApplyDisabledSchemesPolicy, |
| 848 base::Unretained(this))); | 849 base::Unretained(this))); |
| 849 ApplyDisabledSchemesPolicy(); | 850 ApplyDisabledSchemesPolicy(); |
| 851 |
| 852 #if defined(OS_WIN) |
| 853 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 854 switches::kResetShowAppsPromo)) { |
| 855 local_state_->SetBoolean(apps::prefs::kShowAppLauncherPromo, true); |
| 856 } |
| 857 #endif |
| 850 } | 858 } |
| 851 | 859 |
| 852 void BrowserProcessImpl::PreCreateThreads() { | 860 void BrowserProcessImpl::PreCreateThreads() { |
| 853 io_thread_.reset(new IOThread(local_state(), policy_service(), net_log_.get(), | 861 io_thread_.reset(new IOThread(local_state(), policy_service(), net_log_.get(), |
| 854 extension_event_router_forwarder_.get())); | 862 extension_event_router_forwarder_.get())); |
| 855 } | 863 } |
| 856 | 864 |
| 857 void BrowserProcessImpl::PreMainMessageLoopRun() { | 865 void BrowserProcessImpl::PreMainMessageLoopRun() { |
| 858 #if defined(ENABLE_CONFIGURATION_POLICY) | 866 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 859 // browser_policy_connector() is created very early because local_state() | 867 // browser_policy_connector() is created very early because local_state() |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1049 } | 1057 } |
| 1050 | 1058 |
| 1051 void BrowserProcessImpl::OnAutoupdateTimer() { | 1059 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1052 if (CanAutorestartForUpdate()) { | 1060 if (CanAutorestartForUpdate()) { |
| 1053 DLOG(WARNING) << "Detected update. Restarting browser."; | 1061 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1054 RestartBackgroundInstance(); | 1062 RestartBackgroundInstance(); |
| 1055 } | 1063 } |
| 1056 } | 1064 } |
| 1057 | 1065 |
| 1058 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1066 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |