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/background_mode_manager.h" | 19 #include "chrome/browser/background_mode_manager.h" |
20 #include "chrome/browser/browser_main.h" | 20 #include "chrome/browser/browser_main.h" |
21 #include "chrome/browser/browser_process_sub_thread.h" | 21 #include "chrome/browser/browser_process_sub_thread.h" |
22 #include "chrome/browser/browser_trial.h" | 22 #include "chrome/browser/browser_trial.h" |
23 #include "chrome/browser/browsing_data_remover.h" | 23 #include "chrome/browser/browsing_data_remover.h" |
24 #include "chrome/browser/debugger/browser_list_tabcontents_provider.h" | 24 #include "chrome/browser/debugger/browser_list_tabcontents_provider.h" |
25 #include "chrome/browser/debugger/devtools_http_protocol_handler.h" | 25 #include "chrome/browser/debugger/devtools_http_protocol_handler.h" |
26 #include "chrome/browser/debugger/devtools_manager.h" | 26 #include "chrome/browser/debugger/devtools_manager.h" |
27 #include "chrome/browser/debugger/devtools_protocol_handler.h" | 27 #include "chrome/browser/debugger/devtools_protocol_handler.h" |
28 #include "chrome/browser/download/download_file_manager.h" | 28 #include "chrome/browser/download/download_file_manager.h" |
| 29 #include "chrome/browser/download/mhtml_generation_manager.h" |
29 #include "chrome/browser/download/save_file_manager.h" | 30 #include "chrome/browser/download/save_file_manager.h" |
30 #include "chrome/browser/extensions/extension_event_router_forwarder.h" | 31 #include "chrome/browser/extensions/extension_event_router_forwarder.h" |
31 #include "chrome/browser/extensions/extension_tab_id_map.h" | 32 #include "chrome/browser/extensions/extension_tab_id_map.h" |
32 #include "chrome/browser/extensions/user_script_listener.h" | 33 #include "chrome/browser/extensions/user_script_listener.h" |
33 #include "chrome/browser/first_run/upgrade_util.h" | 34 #include "chrome/browser/first_run/upgrade_util.h" |
34 #include "chrome/browser/google/google_url_tracker.h" | 35 #include "chrome/browser/google/google_url_tracker.h" |
35 #include "chrome/browser/icon_manager.h" | 36 #include "chrome/browser/icon_manager.h" |
36 #include "chrome/browser/intranet_redirect_detector.h" | 37 #include "chrome/browser/intranet_redirect_detector.h" |
37 #include "chrome/browser/io_thread.h" | 38 #include "chrome/browser/io_thread.h" |
38 #include "chrome/browser/metrics/metrics_service.h" | 39 #include "chrome/browser/metrics/metrics_service.h" |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 return net_log_.get(); | 685 return net_log_.get(); |
685 } | 686 } |
686 | 687 |
687 prerender::PrerenderTracker* BrowserProcessImpl::prerender_tracker() { | 688 prerender::PrerenderTracker* BrowserProcessImpl::prerender_tracker() { |
688 if (!prerender_tracker_.get()) | 689 if (!prerender_tracker_.get()) |
689 prerender_tracker_.reset(new prerender::PrerenderTracker); | 690 prerender_tracker_.reset(new prerender::PrerenderTracker); |
690 | 691 |
691 return prerender_tracker_.get(); | 692 return prerender_tracker_.get(); |
692 } | 693 } |
693 | 694 |
| 695 MHTMLGenerationManager* BrowserProcessImpl::mhtml_generation_manager() { |
| 696 if (!mhtml_generation_manager_.get()) |
| 697 mhtml_generation_manager_ = new MHTMLGenerationManager(); |
| 698 |
| 699 return mhtml_generation_manager_.get(); |
| 700 } |
| 701 |
694 void BrowserProcessImpl::ClearLocalState(const FilePath& profile_path) { | 702 void BrowserProcessImpl::ClearLocalState(const FilePath& profile_path) { |
695 webkit_database::DatabaseTracker::ClearLocalState(profile_path); | 703 webkit_database::DatabaseTracker::ClearLocalState(profile_path); |
696 BrowsingDataRemover::ClearGearsData(profile_path); | 704 BrowsingDataRemover::ClearGearsData(profile_path); |
697 } | 705 } |
698 | 706 |
699 bool BrowserProcessImpl::ShouldClearLocalState(FilePath* profile_path) { | 707 bool BrowserProcessImpl::ShouldClearLocalState(FilePath* profile_path) { |
700 FilePath user_data_dir; | 708 FilePath user_data_dir; |
701 Profile* profile; | 709 Profile* profile; |
702 | 710 |
703 // Check for the existence of a profile manager. When quitting early, | 711 // Check for the existence of a profile manager. When quitting early, |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 } | 1136 } |
1129 | 1137 |
1130 void BrowserProcessImpl::OnAutoupdateTimer() { | 1138 void BrowserProcessImpl::OnAutoupdateTimer() { |
1131 if (CanAutorestartForUpdate()) { | 1139 if (CanAutorestartForUpdate()) { |
1132 DLOG(WARNING) << "Detected update. Restarting browser."; | 1140 DLOG(WARNING) << "Detected update. Restarting browser."; |
1133 RestartPersistentInstance(); | 1141 RestartPersistentInstance(); |
1134 } | 1142 } |
1135 } | 1143 } |
1136 | 1144 |
1137 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1145 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |