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 |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
14 #include "base/synchronization/waitable_event.h" | 14 #include "base/synchronization/waitable_event.h" |
15 #include "base/task.h" | 15 #include "base/task.h" |
16 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
17 #include "base/threading/thread_restrictions.h" | 17 #include "base/threading/thread_restrictions.h" |
18 #include "chrome/browser/automation/automation_provider_list.h" | 18 #include "chrome/browser/automation/automation_provider_list.h" |
19 #include "chrome/browser/browser_main.h" | 19 #include "chrome/browser/browser_main.h" |
20 #include "chrome/browser/browser_process_sub_thread.h" | 20 #include "chrome/browser/browser_process_sub_thread.h" |
21 #include "chrome/browser/browser_trial.h" | 21 #include "chrome/browser/browser_trial.h" |
| 22 #include "chrome/browser/browsing_data_remover.h" |
22 #include "chrome/browser/debugger/browser_list_tabcontents_provider.h" | 23 #include "chrome/browser/debugger/browser_list_tabcontents_provider.h" |
23 #include "chrome/browser/debugger/devtools_http_protocol_handler.h" | 24 #include "chrome/browser/debugger/devtools_http_protocol_handler.h" |
24 #include "chrome/browser/debugger/devtools_manager.h" | 25 #include "chrome/browser/debugger/devtools_manager.h" |
25 #include "chrome/browser/debugger/devtools_protocol_handler.h" | 26 #include "chrome/browser/debugger/devtools_protocol_handler.h" |
26 #include "chrome/browser/download/download_file_manager.h" | 27 #include "chrome/browser/download/download_file_manager.h" |
27 #include "chrome/browser/download/save_file_manager.h" | 28 #include "chrome/browser/download/save_file_manager.h" |
28 #include "chrome/browser/extensions/extension_event_router_forwarder.h" | 29 #include "chrome/browser/extensions/extension_event_router_forwarder.h" |
29 #include "chrome/browser/extensions/extension_tab_id_map.h" | 30 #include "chrome/browser/extensions/extension_tab_id_map.h" |
30 #include "chrome/browser/extensions/user_script_listener.h" | 31 #include "chrome/browser/extensions/user_script_listener.h" |
31 #include "chrome/browser/first_run/upgrade_util.h" | 32 #include "chrome/browser/first_run/upgrade_util.h" |
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 &BrowserProcessImpl::OnAutoupdateTimer); | 689 &BrowserProcessImpl::OnAutoupdateTimer); |
689 } | 690 } |
690 #endif | 691 #endif |
691 | 692 |
692 ChromeNetLog* BrowserProcessImpl::net_log() { | 693 ChromeNetLog* BrowserProcessImpl::net_log() { |
693 return net_log_.get(); | 694 return net_log_.get(); |
694 } | 695 } |
695 | 696 |
696 void BrowserProcessImpl::ClearLocalState(const FilePath& profile_path) { | 697 void BrowserProcessImpl::ClearLocalState(const FilePath& profile_path) { |
697 webkit_database::DatabaseTracker::ClearLocalState(profile_path); | 698 webkit_database::DatabaseTracker::ClearLocalState(profile_path); |
| 699 BrowsingDataRemover::ClearGearsData(profile_path); |
698 } | 700 } |
699 | 701 |
700 bool BrowserProcessImpl::ShouldClearLocalState(FilePath* profile_path) { | 702 bool BrowserProcessImpl::ShouldClearLocalState(FilePath* profile_path) { |
701 FilePath user_data_dir; | 703 FilePath user_data_dir; |
702 Profile* profile; | 704 Profile* profile; |
703 | 705 |
704 // Check for the existence of a profile manager. When quitting early, | 706 // Check for the existence of a profile manager. When quitting early, |
705 // e.g. because another chrome instance is running, or when invoked with | 707 // e.g. because another chrome instance is running, or when invoked with |
706 // options such as --uninstall or --try-chrome-again=0, the profile manager | 708 // options such as --uninstall or --try-chrome-again=0, the profile manager |
707 // does not exist yet. | 709 // does not exist yet. |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1119 } | 1121 } |
1120 | 1122 |
1121 void BrowserProcessImpl::OnAutoupdateTimer() { | 1123 void BrowserProcessImpl::OnAutoupdateTimer() { |
1122 if (CanAutorestartForUpdate()) { | 1124 if (CanAutorestartForUpdate()) { |
1123 DLOG(WARNING) << "Detected update. Restarting browser."; | 1125 DLOG(WARNING) << "Detected update. Restarting browser."; |
1124 RestartPersistentInstance(); | 1126 RestartPersistentInstance(); |
1125 } | 1127 } |
1126 } | 1128 } |
1127 | 1129 |
1128 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1130 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |