OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/clipboard/clipboard.h" | 7 #include "app/clipboard/clipboard.h" |
8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
12 #include "base/thread.h" | 12 #include "base/thread.h" |
13 #include "base/waitable_event.h" | 13 #include "base/waitable_event.h" |
14 #include "chrome/browser/browser_trial.h" | 14 #include "chrome/browser/browser_trial.h" |
15 #include "chrome/browser/chrome_thread.h" | 15 #include "chrome/browser/chrome_thread.h" |
16 #include "chrome/browser/debugger/debugger_wrapper.h" | 16 #include "chrome/browser/debugger/debugger_wrapper.h" |
17 #include "chrome/browser/debugger/devtools_manager.h" | 17 #include "chrome/browser/debugger/devtools_manager.h" |
18 #include "chrome/browser/download/download_file.h" | 18 #include "chrome/browser/download/download_file.h" |
19 #include "chrome/browser/download/save_file_manager.h" | 19 #include "chrome/browser/download/save_file_manager.h" |
20 #include "chrome/browser/google_url_tracker.h" | 20 #include "chrome/browser/google_url_tracker.h" |
21 #include "chrome/browser/icon_manager.h" | 21 #include "chrome/browser/icon_manager.h" |
22 #include "chrome/browser/metrics/metrics_service.h" | 22 #include "chrome/browser/metrics/metrics_service.h" |
23 #include "chrome/browser/net/dns_global.h" | 23 #include "chrome/browser/net/dns_global.h" |
24 #include "chrome/browser/net/sdch_dictionary_fetcher.h" | 24 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
| 25 #include "chrome/browser/notifications/notification_ui_manager.h" |
25 #include "chrome/browser/plugin_service.h" | 26 #include "chrome/browser/plugin_service.h" |
26 #include "chrome/browser/profile_manager.h" | 27 #include "chrome/browser/profile_manager.h" |
27 #include "chrome/browser/renderer_host/render_process_host.h" | 28 #include "chrome/browser/renderer_host/render_process_host.h" |
28 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 29 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
29 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 30 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
30 #include "chrome/common/chrome_paths.h" | 31 #include "chrome/common/chrome_paths.h" |
31 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
32 #include "chrome/common/notification_service.h" | 33 #include "chrome/common/notification_service.h" |
33 #include "chrome/common/pref_names.h" | 34 #include "chrome/common/pref_names.h" |
34 #include "chrome/common/pref_service.h" | 35 #include "chrome/common/pref_service.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 created_db_thread_(false), | 141 created_db_thread_(false), |
141 created_profile_manager_(false), | 142 created_profile_manager_(false), |
142 created_local_state_(false), | 143 created_local_state_(false), |
143 #if defined(OS_WIN) | 144 #if defined(OS_WIN) |
144 initialized_broker_services_(false), | 145 initialized_broker_services_(false), |
145 broker_services_(NULL), | 146 broker_services_(NULL), |
146 #endif // defined(OS_WIN) | 147 #endif // defined(OS_WIN) |
147 created_icon_manager_(false), | 148 created_icon_manager_(false), |
148 created_debugger_wrapper_(false), | 149 created_debugger_wrapper_(false), |
149 created_devtools_manager_(false), | 150 created_devtools_manager_(false), |
| 151 created_notification_ui_manager_(false), |
150 module_ref_count_(0), | 152 module_ref_count_(0), |
151 checked_for_new_frames_(false), | 153 checked_for_new_frames_(false), |
152 using_new_frames_(false), | 154 using_new_frames_(false), |
153 have_inspector_files_(true) { | 155 have_inspector_files_(true) { |
154 g_browser_process = this; | 156 g_browser_process = this; |
155 clipboard_.reset(new Clipboard); | 157 clipboard_.reset(new Clipboard); |
156 main_notification_service_.reset(new NotificationService); | 158 main_notification_service_.reset(new NotificationService); |
157 | 159 |
158 // Must be created after the NotificationService. | 160 // Must be created after the NotificationService. |
159 print_job_manager_.reset(new printing::PrintJobManager); | 161 print_job_manager_.reset(new printing::PrintJobManager); |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 created_devtools_manager_ = true; | 428 created_devtools_manager_ = true; |
427 devtools_manager_ = new DevToolsManager(); | 429 devtools_manager_ = new DevToolsManager(); |
428 } | 430 } |
429 | 431 |
430 void BrowserProcessImpl::CreateGoogleURLTracker() { | 432 void BrowserProcessImpl::CreateGoogleURLTracker() { |
431 DCHECK(google_url_tracker_.get() == NULL); | 433 DCHECK(google_url_tracker_.get() == NULL); |
432 scoped_ptr<GoogleURLTracker> google_url_tracker(new GoogleURLTracker); | 434 scoped_ptr<GoogleURLTracker> google_url_tracker(new GoogleURLTracker); |
433 google_url_tracker_.swap(google_url_tracker); | 435 google_url_tracker_.swap(google_url_tracker); |
434 } | 436 } |
435 | 437 |
| 438 void BrowserProcessImpl::CreateNotificationUIManager() { |
| 439 DCHECK(notification_ui_manager_.get() == NULL); |
| 440 notification_ui_manager_.reset(NotificationUIManager::Create()); |
| 441 created_notification_ui_manager_ = true; |
| 442 } |
| 443 |
436 // The BrowserProcess object must outlive the file thread so we use traits | 444 // The BrowserProcess object must outlive the file thread so we use traits |
437 // which don't do any management. | 445 // which don't do any management. |
438 template <> | 446 template <> |
439 struct RunnableMethodTraits<BrowserProcessImpl> { | 447 struct RunnableMethodTraits<BrowserProcessImpl> { |
440 void RetainCallee(BrowserProcessImpl* process) {} | 448 void RetainCallee(BrowserProcessImpl* process) {} |
441 void ReleaseCallee(BrowserProcessImpl* process) {} | 449 void ReleaseCallee(BrowserProcessImpl* process) {} |
442 }; | 450 }; |
443 | 451 |
444 void BrowserProcessImpl::CheckForInspectorFiles() { | 452 void BrowserProcessImpl::CheckForInspectorFiles() { |
445 file_thread()->message_loop()->PostTask | 453 file_thread()->message_loop()->PostTask |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 DCHECK(file_thread_->message_loop() == MessageLoop::current()); | 498 DCHECK(file_thread_->message_loop() == MessageLoop::current()); |
491 bool result = false; | 499 bool result = false; |
492 | 500 |
493 FilePath inspector_dir; | 501 FilePath inspector_dir; |
494 if (PathService::Get(chrome::DIR_INSPECTOR, &inspector_dir)) { | 502 if (PathService::Get(chrome::DIR_INSPECTOR, &inspector_dir)) { |
495 result = file_util::PathExists(inspector_dir); | 503 result = file_util::PathExists(inspector_dir); |
496 } | 504 } |
497 | 505 |
498 have_inspector_files_ = result; | 506 have_inspector_files_ = result; |
499 } | 507 } |
OLD | NEW |