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

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

Issue 10963061: Switch AutomationTabHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/automation/automation_tab_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/automation/automation_provider_observers.cc
diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc
index 849c7cf9ad84af97466f5ddd9c386152edc6d6d4..4cea31e2875eb65ef567bb92e3735627ea719e4a 100644
--- a/chrome/browser/automation/automation_provider_observers.cc
+++ b/chrome/browser/automation/automation_provider_observers.cc
@@ -1785,8 +1785,10 @@ PageSnapshotTaker::PageSnapshotTaker(AutomationProvider* automation,
PageSnapshotTaker::~PageSnapshotTaker() {}
void PageSnapshotTaker::Start() {
- StartObserving(tab_contents_->automation_tab_helper());
- tab_contents_->automation_tab_helper()->SnapshotEntirePage();
+ AutomationTabHelper* automation_tab_helper =
+ AutomationTabHelper::FromWebContents(tab_contents_->web_contents());
+ StartObserving(automation_tab_helper);
+ automation_tab_helper->SnapshotEntirePage();
}
void PageSnapshotTaker::OnSnapshotEntirePageACK(
@@ -2361,10 +2363,12 @@ AllViewsStoppedLoadingObserver::AllViewsStoppedLoadingObserver(
++iter) {
Browser* browser = *iter;
for (int i = 0; i < browser->tab_count(); ++i) {
- TabContents* tab_contents = chrome::GetTabContentsAt(browser, i);
- StartObserving(tab_contents->automation_tab_helper());
- if (tab_contents->automation_tab_helper()->has_pending_loads())
- pending_tabs_.insert(tab_contents->web_contents());
+ WebContents* web_contents = chrome::GetWebContentsAt(browser, i);
+ AutomationTabHelper* automation_tab_helper =
+ AutomationTabHelper::FromWebContents(web_contents);
+ StartObserving(automation_tab_helper);
+ if (automation_tab_helper->has_pending_loads())
+ pending_tabs_.insert(web_contents);
}
}
CheckIfNoMorePendingLoads();
« no previous file with comments | « no previous file | chrome/browser/automation/automation_tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698