Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Side by Side Diff: chrome/browser/profile.cc

Issue 159882: Implements extensions devtools API (Closed)
Patch Set: Fixes flakiness in tests by grabbing tab ID in C++ land and passing it down Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/profile.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/profile.h" 5 #include "chrome/browser/profile.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/scoped_ptr.h" 10 #include "base/scoped_ptr.h"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 #include "chrome/browser/bookmarks/bookmark_model.h" 12 #include "chrome/browser/bookmarks/bookmark_model.h"
13 #include "chrome/browser/browser_list.h" 13 #include "chrome/browser/browser_list.h"
14 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/browser_theme_provider.h" 15 #include "chrome/browser/browser_theme_provider.h"
16 #include "chrome/browser/download/download_manager.h" 16 #include "chrome/browser/download/download_manager.h"
17 #include "chrome/browser/extensions/extension_devtools_manager.h"
17 #include "chrome/browser/extensions/extension_message_service.h" 18 #include "chrome/browser/extensions/extension_message_service.h"
18 #include "chrome/browser/extensions/extension_process_manager.h" 19 #include "chrome/browser/extensions/extension_process_manager.h"
19 #include "chrome/browser/extensions/extensions_service.h" 20 #include "chrome/browser/extensions/extensions_service.h"
20 #include "chrome/browser/extensions/user_script_master.h" 21 #include "chrome/browser/extensions/user_script_master.h"
21 #include "chrome/browser/history/history.h" 22 #include "chrome/browser/history/history.h"
22 #include "chrome/browser/in_process_webkit/webkit_context.h" 23 #include "chrome/browser/in_process_webkit/webkit_context.h"
23 #include "chrome/browser/net/chrome_url_request_context.h" 24 #include "chrome/browser/net/chrome_url_request_context.h"
24 #include "chrome/browser/net/ssl_config_service_manager.h" 25 #include "chrome/browser/net/ssl_config_service_manager.h"
25 #include "chrome/browser/password_manager/password_store_default.h" 26 #include "chrome/browser/password_manager/password_store_default.h"
26 #include "chrome/browser/privacy_blacklist/blacklist.h" 27 #include "chrome/browser/privacy_blacklist/blacklist.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 } 214 }
214 215
215 virtual ExtensionsService* GetExtensionsService() { 216 virtual ExtensionsService* GetExtensionsService() {
216 return NULL; 217 return NULL;
217 } 218 }
218 219
219 virtual UserScriptMaster* GetUserScriptMaster() { 220 virtual UserScriptMaster* GetUserScriptMaster() {
220 return profile_->GetUserScriptMaster(); 221 return profile_->GetUserScriptMaster();
221 } 222 }
222 223
224 virtual ExtensionDevToolsManager* GetExtensionDevToolsManager() {
225 return NULL;
226 }
227
223 virtual ExtensionProcessManager* GetExtensionProcessManager() { 228 virtual ExtensionProcessManager* GetExtensionProcessManager() {
224 return NULL; 229 return NULL;
225 } 230 }
226 231
227 virtual ExtensionMessageService* GetExtensionMessageService() { 232 virtual ExtensionMessageService* GetExtensionMessageService() {
228 return NULL; 233 return NULL;
229 } 234 }
230 235
231 virtual SSLHostState* GetSSLHostState() { 236 virtual SSLHostState* GetSSLHostState() {
232 if (!ssl_host_state_.get()) 237 if (!ssl_host_state_.get())
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 492
488 // Time we were started. 493 // Time we were started.
489 Time start_time_; 494 Time start_time_;
490 495
491 DISALLOW_EVIL_CONSTRUCTORS(OffTheRecordProfileImpl); 496 DISALLOW_EVIL_CONSTRUCTORS(OffTheRecordProfileImpl);
492 }; 497 };
493 498
494 ProfileImpl::ProfileImpl(const FilePath& path) 499 ProfileImpl::ProfileImpl(const FilePath& path)
495 : path_(path), 500 : path_(path),
496 visited_link_event_listener_(new VisitedLinkEventListener()), 501 visited_link_event_listener_(new VisitedLinkEventListener()),
502 extension_devtools_manager_(NULL),
497 request_context_(NULL), 503 request_context_(NULL),
498 media_request_context_(NULL), 504 media_request_context_(NULL),
499 extensions_request_context_(NULL), 505 extensions_request_context_(NULL),
500 blacklist_(NULL), 506 blacklist_(NULL),
501 history_service_created_(false), 507 history_service_created_(false),
502 created_web_data_service_(false), 508 created_web_data_service_(false),
503 created_password_store_(false), 509 created_password_store_(false),
504 created_download_manager_(false), 510 created_download_manager_(false),
505 created_theme_provider_(false), 511 created_theme_provider_(false),
506 start_time_(Time::Now()), 512 start_time_(Time::Now()),
507 spellchecker_(NULL), 513 spellchecker_(NULL),
508 shutdown_session_service_(false) { 514 shutdown_session_service_(false) {
509 DCHECK(!path.empty()) << "Using an empty path will attempt to write " << 515 DCHECK(!path.empty()) << "Using an empty path will attempt to write " <<
510 "profile files to the root directory!"; 516 "profile files to the root directory!";
511 create_session_service_timer_.Start( 517 create_session_service_timer_.Start(
512 TimeDelta::FromMilliseconds(kCreateSessionServiceDelayMS), this, 518 TimeDelta::FromMilliseconds(kCreateSessionServiceDelayMS), this,
513 &ProfileImpl::EnsureSessionServiceCreated); 519 &ProfileImpl::EnsureSessionServiceCreated);
514 520
521 if (CommandLine::ForCurrentProcess()->HasSwitch(
522 switches::kEnableExtensionTimelineApi)) {
523 extension_devtools_manager_ = new ExtensionDevToolsManager(this);
524 }
525
515 extension_process_manager_.reset(new ExtensionProcessManager(this)); 526 extension_process_manager_.reset(new ExtensionProcessManager(this));
516 extension_message_service_ = new ExtensionMessageService(this); 527 extension_message_service_ = new ExtensionMessageService(this);
517 528
518 PrefService* prefs = GetPrefs(); 529 PrefService* prefs = GetPrefs();
519 prefs->AddPrefObserver(prefs::kSpellCheckDictionary, this); 530 prefs->AddPrefObserver(prefs::kSpellCheckDictionary, this);
520 prefs->AddPrefObserver(prefs::kEnableSpellCheck, this); 531 prefs->AddPrefObserver(prefs::kEnableSpellCheck, this);
521 prefs->AddPrefObserver(prefs::kEnableAutoSpellCorrect, this); 532 prefs->AddPrefObserver(prefs::kEnableAutoSpellCorrect, this);
522 533
523 if (CommandLine::ForCurrentProcess()-> 534 if (CommandLine::ForCurrentProcess()->
524 HasSwitch(switches::kPrivacyBlacklist)) { 535 HasSwitch(switches::kPrivacyBlacklist)) {
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 } 748 }
738 749
739 ExtensionsService* ProfileImpl::GetExtensionsService() { 750 ExtensionsService* ProfileImpl::GetExtensionsService() {
740 return extensions_service_.get(); 751 return extensions_service_.get();
741 } 752 }
742 753
743 UserScriptMaster* ProfileImpl::GetUserScriptMaster() { 754 UserScriptMaster* ProfileImpl::GetUserScriptMaster() {
744 return user_script_master_.get(); 755 return user_script_master_.get();
745 } 756 }
746 757
758 ExtensionDevToolsManager* ProfileImpl::GetExtensionDevToolsManager() {
759 return extension_devtools_manager_.get();
760 }
761
747 ExtensionProcessManager* ProfileImpl::GetExtensionProcessManager() { 762 ExtensionProcessManager* ProfileImpl::GetExtensionProcessManager() {
748 return extension_process_manager_.get(); 763 return extension_process_manager_.get();
749 } 764 }
750 765
751 ExtensionMessageService* ProfileImpl::GetExtensionMessageService() { 766 ExtensionMessageService* ProfileImpl::GetExtensionMessageService() {
752 return extension_message_service_.get(); 767 return extension_message_service_.get();
753 } 768 }
754 769
755 SSLHostState* ProfileImpl::GetSSLHostState() { 770 SSLHostState* ProfileImpl::GetSSLHostState() {
756 if (!ssl_host_state_.get()) 771 if (!ssl_host_state_.get())
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
1241 #endif 1256 #endif
1242 return NULL; 1257 return NULL;
1243 } 1258 }
1244 1259
1245 void ProfileImpl::InitSyncService() { 1260 void ProfileImpl::InitSyncService() {
1246 #ifdef CHROME_PERSONALIZATION 1261 #ifdef CHROME_PERSONALIZATION
1247 sync_service_.reset(new ProfileSyncService(this)); 1262 sync_service_.reset(new ProfileSyncService(this));
1248 sync_service_->Initialize(); 1263 sync_service_->Initialize();
1249 #endif 1264 #endif
1250 } 1265 }
OLDNEW
« no previous file with comments | « chrome/browser/profile.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698