| 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.
|
|
|