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

Unified Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 7464009: Removal of Profile from content part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: browser_context Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/automation/testing_automation_provider.cc
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc
index 629454121bf385e7d238ba3a200c92297e7bfe9a..e857c771be4a4abd3c4557bf3177fc40553bd787 100644
--- a/chrome/browser/automation/testing_automation_provider.cc
+++ b/chrome/browser/automation/testing_automation_provider.cc
@@ -701,9 +701,10 @@ void TestingAutomationProvider::GetRedirectsFrom(int tab_handle,
if (redirect_query_) {
LOG(ERROR) << "Can only handle one redirect query at once.";
} else if (tab_tracker_->ContainsHandle(tab_handle)) {
- NavigationController* tab = tab_tracker_->GetResource(tab_handle);
+ NavigationController* nav = tab_tracker_->GetResource(tab_handle);
+ Profile* profile = static_cast<Profile*>(nav->browser_context());
HistoryService* history_service =
- tab->profile()->GetHistoryService(Profile::EXPLICIT_ACCESS);
+ profile->GetHistoryService(Profile::EXPLICIT_ACCESS);
DCHECK(history_service) << "Tab " << tab_handle << "'s profile " <<
"has no history service";
@@ -1320,8 +1321,9 @@ void TestingAutomationProvider::HandleInspectElementRequest(
void TestingAutomationProvider::GetDownloadDirectory(
int handle, FilePath* download_directory) {
if (tab_tracker_->ContainsHandle(handle)) {
- NavigationController* tab = tab_tracker_->GetResource(handle);
- DownloadManager* dlm = tab->profile()->GetDownloadManager();
+ NavigationController* nav = tab_tracker_->GetResource(handle);
+ Profile* profile = static_cast<Profile*>(nav->browser_context());
+ DownloadManager* dlm = profile->GetDownloadManager();
*download_directory = dlm->download_prefs()->download_path();
}
}
@@ -4269,10 +4271,11 @@ void TestingAutomationProvider::GetAutofillProfile(
return;
}
- TabContents* tab_contents = browser->GetTabContentsAt(tab_index);
+ TabContentsWrapper* tab_contents =
+ browser->GetTabContentsWrapperAt(tab_index);
if (tab_contents) {
- PersonalDataManager* pdm = tab_contents->profile()->GetOriginalProfile()
- ->GetPersonalDataManager();
+ PersonalDataManager* pdm =
+ tab_contents->profile()->GetOriginalProfile()->GetPersonalDataManager();
if (pdm) {
std::vector<AutofillProfile*> autofill_profiles = pdm->profiles();
std::vector<CreditCard*> credit_cards = pdm->credit_cards();
@@ -4334,11 +4337,12 @@ void TestingAutomationProvider::FillAutofillProfile(
return;
}
- TabContents* tab_contents = browser->GetTabContentsAt(tab_index);
+ TabContentsWrapper* tab_contents =
+ browser->GetTabContentsWrapperAt(tab_index);
if (tab_contents) {
- PersonalDataManager* pdm = tab_contents->profile()
- ->GetPersonalDataManager();
+ PersonalDataManager* pdm =
+ tab_contents->profile()->GetPersonalDataManager();
if (pdm) {
if (profiles || cards) {
// This observer will delete itself.

Powered by Google App Engine
This is Rietveld 408576698