OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 #include "content/common/notification_service.h" | 83 #include "content/common/notification_service.h" |
84 #include "ipc/ipc_logging.h" | 84 #include "ipc/ipc_logging.h" |
85 #include "net/socket/client_socket_pool_manager.h" | 85 #include "net/socket/client_socket_pool_manager.h" |
86 #include "net/url_request/url_request_context_getter.h" | 86 #include "net/url_request/url_request_context_getter.h" |
87 #include "ui/base/clipboard/clipboard.h" | 87 #include "ui/base/clipboard/clipboard.h" |
88 #include "ui/base/l10n/l10n_util.h" | 88 #include "ui/base/l10n/l10n_util.h" |
89 #include "webkit/plugins/npapi/plugin_list.h" | 89 #include "webkit/plugins/npapi/plugin_list.h" |
90 | 90 |
91 #if defined(OS_WIN) | 91 #if defined(OS_WIN) |
92 #include "views/focus/view_storage.h" | 92 #include "views/focus/view_storage.h" |
| 93 #elif defined(OS_MACOSX) |
| 94 #include "chrome/browser/chrome_browser_main_mac.h" |
93 #endif | 95 #endif |
94 | 96 |
95 #if defined(IPC_MESSAGE_LOG_ENABLED) | 97 #if defined(IPC_MESSAGE_LOG_ENABLED) |
96 #include "content/common/child_process_messages.h" | 98 #include "content/common/child_process_messages.h" |
97 #endif | 99 #endif |
98 | 100 |
99 #if defined(OS_CHROMEOS) | 101 #if defined(OS_CHROMEOS) |
100 #include "chrome/browser/chromeos/proxy_config_service_impl.h" | 102 #include "chrome/browser/chromeos/proxy_config_service_impl.h" |
101 #include "chrome/browser/chromeos/web_socket_proxy_controller.h" | 103 #include "chrome/browser/chromeos/web_socket_proxy_controller.h" |
102 #endif // defined(OS_CHROMEOS) | 104 #endif // defined(OS_CHROMEOS) |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 DCHECK_NE(0u, module_ref_count_); | 314 DCHECK_NE(0u, module_ref_count_); |
313 module_ref_count_--; | 315 module_ref_count_--; |
314 if (0 == module_ref_count_) { | 316 if (0 == module_ref_count_) { |
315 // Allow UI and IO threads to do blocking IO on shutdown, since we do a lot | 317 // Allow UI and IO threads to do blocking IO on shutdown, since we do a lot |
316 // of it on shutdown for valid reasons. | 318 // of it on shutdown for valid reasons. |
317 base::ThreadRestrictions::SetIOAllowed(true); | 319 base::ThreadRestrictions::SetIOAllowed(true); |
318 CHECK(!BrowserList::GetLastActive()); | 320 CHECK(!BrowserList::GetLastActive()); |
319 io_thread()->message_loop()->PostTask( | 321 io_thread()->message_loop()->PostTask( |
320 FROM_HERE, | 322 FROM_HERE, |
321 NewRunnableFunction(&base::ThreadRestrictions::SetIOAllowed, true)); | 323 NewRunnableFunction(&base::ThreadRestrictions::SetIOAllowed, true)); |
| 324 |
| 325 #if defined(OS_MACOSX) |
322 MessageLoop::current()->PostTask( | 326 MessageLoop::current()->PostTask( |
323 FROM_HERE, NewRunnableFunction(content::DidEndMainMessageLoop)); | 327 FROM_HERE, |
| 328 NewRunnableFunction(ChromeBrowserMainPartsMac::DidEndMainMessageLoop)); |
| 329 #endif |
324 MessageLoop::current()->Quit(); | 330 MessageLoop::current()->Quit(); |
325 } | 331 } |
326 return module_ref_count_; | 332 return module_ref_count_; |
327 } | 333 } |
328 | 334 |
329 void BrowserProcessImpl::EndSession() { | 335 void BrowserProcessImpl::EndSession() { |
330 // Mark all the profiles as clean. | 336 // Mark all the profiles as clean. |
331 ProfileManager* pm = profile_manager(); | 337 ProfileManager* pm = profile_manager(); |
332 std::vector<Profile*> profiles(pm->GetLoadedProfiles()); | 338 std::vector<Profile*> profiles(pm->GetLoadedProfiles()); |
333 for (size_t i = 0; i < profiles.size(); ++i) | 339 for (size_t i = 0; i < profiles.size(); ++i) |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1119 } | 1125 } |
1120 | 1126 |
1121 void BrowserProcessImpl::OnAutoupdateTimer() { | 1127 void BrowserProcessImpl::OnAutoupdateTimer() { |
1122 if (CanAutorestartForUpdate()) { | 1128 if (CanAutorestartForUpdate()) { |
1123 DLOG(WARNING) << "Detected update. Restarting browser."; | 1129 DLOG(WARNING) << "Detected update. Restarting browser."; |
1124 RestartPersistentInstance(); | 1130 RestartPersistentInstance(); |
1125 } | 1131 } |
1126 } | 1132 } |
1127 | 1133 |
1128 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1134 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |