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

Unified Diff: chrome/browser/ui/panels/panel.cc

Issue 9015022: Replace most of Browser::GetSelectedTabContents calls into Browser::GetSelectedWebContents. I've ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 12 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 | « chrome/browser/ui/panels/panel.h ('k') | chrome/browser/ui/panels/panel_browser_frame_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/panels/panel.cc
===================================================================
--- chrome/browser/ui/panels/panel.cc (revision 116109)
+++ chrome/browser/ui/panels/panel.cc (working copy)
@@ -107,9 +107,9 @@
auto_resizable_ = resizable;
if (auto_resizable_) {
browser()->tabstrip_model()->AddObserver(this);
- TabContents* tab_contents = browser()->GetSelectedTabContents();
- if (tab_contents)
- EnableTabContentsAutoResize(tab_contents);
+ WebContents* web_contents = browser()->GetSelectedWebContents();
+ if (web_contents)
+ EnableWebContentsAutoResize(web_contents);
} else {
browser()->tabstrip_model()->RemoveObserver(this);
registrar_.RemoveAll();
@@ -125,7 +125,7 @@
min_size_ = min_size;
max_size_ = max_size;
- ConfigureAutoResize(browser()->GetSelectedTabContents());
+ ConfigureAutoResize(browser()->GetSelectedWebContents());
}
void Panel::SetAppIconVisibility(bool visible) {
@@ -598,36 +598,36 @@
bool foreground) {
if (auto_resizable_) {
DCHECK_EQ(0, index);
- EnableTabContentsAutoResize(contents->tab_contents());
+ EnableWebContentsAutoResize(contents->web_contents());
}
}
-void Panel::EnableTabContentsAutoResize(TabContents* tab_contents) {
- DCHECK(tab_contents);
- ConfigureAutoResize(tab_contents);
+void Panel::EnableWebContentsAutoResize(WebContents* web_contents) {
+ DCHECK(web_contents);
+ ConfigureAutoResize(web_contents);
// We also need to know when the render view host changes in order
// to turn on auto-resize notifications in the new render view host.
registrar_.RemoveAll(); // Stop notifications for previous contents, if any.
registrar_.Add(
this,
- content::NOTIFICATION_TAB_CONTENTS_SWAPPED,
- content::Source<TabContents>(tab_contents));
+ content::NOTIFICATION_WEB_CONTENTS_SWAPPED,
+ content::Source<WebContents>(web_contents));
}
void Panel::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- DCHECK_EQ(type, content::NOTIFICATION_TAB_CONTENTS_SWAPPED);
- ConfigureAutoResize(content::Source<TabContents>(source).ptr());
+ DCHECK_EQ(type, content::NOTIFICATION_WEB_CONTENTS_SWAPPED);
+ ConfigureAutoResize(content::Source<WebContents>(source).ptr());
}
-void Panel::ConfigureAutoResize(TabContents* tab_contents) {
- if (!auto_resizable_ || !tab_contents)
+void Panel::ConfigureAutoResize(WebContents* web_contents) {
+ if (!auto_resizable_ || !web_contents)
return;
// NULL might be returned if the tab has not been added.
- RenderViewHost* render_view_host = tab_contents->GetRenderViewHost();
+ RenderViewHost* render_view_host = web_contents->GetRenderViewHost();
if (!render_view_host)
return;
@@ -637,7 +637,7 @@
}
void Panel::OnWindowSizeAvailable() {
- ConfigureAutoResize(browser()->GetSelectedTabContents());
+ ConfigureAutoResize(browser()->GetSelectedWebContents());
}
void Panel::DestroyBrowser() {
« no previous file with comments | « chrome/browser/ui/panels/panel.h ('k') | chrome/browser/ui/panels/panel_browser_frame_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698