Commit 3bbacc5b authored by avi@chromium.org's avatar avi@chromium.org

TabContents -> WebContentsImpl, part 19.

BUG=105875
TEST=no change


Review URL: http://codereview.chromium.org/10106022

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132599 0039d316-1c4b-4281-b951-d872f2087c98
parent 1dda5abe
...@@ -54,7 +54,7 @@ class BrowserPluginWebContentsObserver: public WebContentsObserver, ...@@ -54,7 +54,7 @@ class BrowserPluginWebContentsObserver: public WebContentsObserver,
virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE;
virtual void WebContentsDestroyed(WebContents* tab) OVERRIDE; virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE;
private: private:
typedef std::map<WebContentsImpl*, int64> GuestMap; typedef std::map<WebContentsImpl*, int64> GuestMap;
......
...@@ -46,13 +46,13 @@ IN_PROC_BROWSER_TEST_F(ChildProcessSecurityPolicyInProcessBrowserTest, NoLeak) { ...@@ -46,13 +46,13 @@ IN_PROC_BROWSER_TEST_F(ChildProcessSecurityPolicyInProcessBrowserTest, NoLeak) {
ChildProcessSecurityPolicyImpl::GetInstance()->security_state_.size(), ChildProcessSecurityPolicyImpl::GetInstance()->security_state_.size(),
1U); 1U);
WebContents* tab = browser()->GetWebContentsAt(0); WebContents* web_contents = browser()->GetWebContentsAt(0);
ASSERT_TRUE(tab != NULL); ASSERT_TRUE(web_contents != NULL);
base::KillProcess(tab->GetRenderProcessHost()->GetHandle(), base::KillProcess(web_contents->GetRenderProcessHost()->GetHandle(),
content::RESULT_CODE_KILLED, true); content::RESULT_CODE_KILLED, true);
tab->GetController().Reload(true); web_contents->GetController().Reload(true);
EXPECT_EQ( EXPECT_EQ(
ChildProcessSecurityPolicyImpl::GetInstance()->security_state_.size(), 1U,
1U); ChildProcessSecurityPolicyImpl::GetInstance()->security_state_.size());
} }
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -56,9 +56,10 @@ IN_PROC_BROWSER_TEST_F(MHTMLGenerationTest, GenerateMHTML) { ...@@ -56,9 +56,10 @@ IN_PROC_BROWSER_TEST_F(MHTMLGenerationTest, GenerateMHTML) {
ui_test_utils::NavigateToURL(browser(), ui_test_utils::NavigateToURL(browser(),
test_server()->GetURL("files/google/google.html")); test_server()->GetURL("files/google/google.html"));
WebContents* tab = browser()->GetSelectedWebContents(); WebContents* web_contents = browser()->GetSelectedWebContents();
tab->GenerateMHTML(path, web_contents->GenerateMHTML(path,
base::Bind(&MHTMLGenerationTest::MHTMLGenerated, this)); base::Bind(&MHTMLGenerationTest::MHTMLGenerated,
this));
// Block until the MHTML is generated. // Block until the MHTML is generated.
ui_test_utils::RunMessageLoop(); ui_test_utils::RunMessageLoop();
......
...@@ -123,7 +123,7 @@ void AcceleratedSurfaceBuffersSwappedCompleted(int host_id, ...@@ -123,7 +123,7 @@ void AcceleratedSurfaceBuffersSwappedCompleted(int host_id,
#if defined(TOOLKIT_GTK) #if defined(TOOLKIT_GTK)
// Used to put a lock on surfaces so that the window to which the GPU // Used to put a lock on surfaces so that the window to which the GPU
// process is drawing to doesn't disappear while it is drawing when // process is drawing to doesn't disappear while it is drawing when
// a tab is closed. // a WebContents is closed.
class GpuProcessHost::SurfaceRef { class GpuProcessHost::SurfaceRef {
public: public:
explicit SurfaceRef(gfx::PluginWindowHandle surface); explicit SurfaceRef(gfx::PluginWindowHandle surface);
......
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -36,15 +36,15 @@ class CONTENT_EXPORT HostZoomMapImpl ...@@ -36,15 +36,15 @@ class CONTENT_EXPORT HostZoomMapImpl
virtual void SetDefaultZoomLevel(double level) OVERRIDE; virtual void SetDefaultZoomLevel(double level) OVERRIDE;
// Returns the temporary zoom level that's only valid for the lifetime of // Returns the temporary zoom level that's only valid for the lifetime of
// the given tab (i.e. isn't saved and doesn't affect other tabs) if it // the given WebContents (i.e. isn't saved and doesn't affect other
// exists, the default zoom level otherwise. // WebContentses) if it exists, the default zoom level otherwise.
// //
// This may be called on any thread. // This may be called on any thread.
double GetTemporaryZoomLevel(int render_process_id, double GetTemporaryZoomLevel(int render_process_id,
int render_view_id) const; int render_view_id) const;
// Sets the temporary zoom level that's only valid for the lifetime of this // Sets the temporary zoom level that's only valid for the lifetime of this
// tab. // WebContents.
// //
// This should only be called on the UI thread. // This should only be called on the UI thread.
void SetTemporaryZoomLevel(int render_process_id, void SetTemporaryZoomLevel(int render_process_id,
......
...@@ -128,8 +128,8 @@ BackingStore* CreateBackingStore(RenderWidgetHost* host, ...@@ -128,8 +128,8 @@ BackingStore* CreateBackingStore(RenderWidgetHost* host,
if (current_mem + new_mem > max_mem) { if (current_mem + new_mem > max_mem) {
// Need to remove old backing stores to make room for the new one. We // Need to remove old backing stores to make room for the new one. We
// don't want to do this when the backing store is being replace by a new // don't want to do this when the backing store is being replace by a new
// one for the same tab, but this case won't get called then: we'll have // one for the same WebContents, but this case won't get called then: we'll
// removed the old one in the RemoveBackingStore above, and the cache // have removed the old one in the RemoveBackingStore above, and the cache
// won't be over-sized. // won't be over-sized.
CreateCacheSpace((current_mem + new_mem) - max_mem); CreateCacheSpace((current_mem + new_mem) - max_mem);
} }
......
...@@ -233,8 +233,8 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostTest, BaseURLParam) { ...@@ -233,8 +233,8 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostTest, BaseURLParam) {
// Test that a hung renderer is killed after navigating away during cross-site // Test that a hung renderer is killed after navigating away during cross-site
// navigation. // navigation.
IN_PROC_BROWSER_TEST_F(RenderViewHostTest, UnresponsiveCrossSiteNavigation) { IN_PROC_BROWSER_TEST_F(RenderViewHostTest, UnresponsiveCrossSiteNavigation) {
WebContents* tab = NULL; WebContents* web_contents = NULL;
WebContents* tab2 = NULL; WebContents* web_contents_2 = NULL;
content::RenderProcessHost* rph = NULL; content::RenderProcessHost* rph = NULL;
base::ProcessHandle process; base::ProcessHandle process;
FilePath doc_root; FilePath doc_root;
...@@ -260,9 +260,9 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostTest, UnresponsiveCrossSiteNavigation) { ...@@ -260,9 +260,9 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostTest, UnresponsiveCrossSiteNavigation) {
// Navigate the tab to the page which will lock up the process when we // Navigate the tab to the page which will lock up the process when we
// navigate away from it. // navigate away from it.
ui_test_utils::NavigateToURL(browser(), infinite_beforeunload_url); ui_test_utils::NavigateToURL(browser(), infinite_beforeunload_url);
tab = browser()->GetWebContentsAt(0); web_contents = browser()->GetWebContentsAt(0);
rph = tab->GetRenderProcessHost(); rph = web_contents->GetRenderProcessHost();
EXPECT_EQ(tab->GetURL(), infinite_beforeunload_url); EXPECT_EQ(web_contents->GetURL(), infinite_beforeunload_url);
// Remember the process prior to navigation, as we expect it to get killed. // Remember the process prior to navigation, as we expect it to get killed.
process = rph->GetHandle(); process = rph->GetHandle();
...@@ -285,10 +285,10 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostTest, UnresponsiveCrossSiteNavigation) { ...@@ -285,10 +285,10 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostTest, UnresponsiveCrossSiteNavigation) {
} }
ui_test_utils::NavigateToURL(browser(), same_process_url); ui_test_utils::NavigateToURL(browser(), same_process_url);
tab = browser()->GetWebContentsAt(0); web_contents = browser()->GetWebContentsAt(0);
rph = tab->GetRenderProcessHost(); rph = web_contents->GetRenderProcessHost();
ASSERT_TRUE(tab != NULL); ASSERT_TRUE(web_contents != NULL);
EXPECT_EQ(tab->GetURL(), same_process_url); EXPECT_EQ(web_contents->GetURL(), same_process_url);
// Now, let's open another tab with the unresponsive page, which will cause // Now, let's open another tab with the unresponsive page, which will cause
// the previous page and the unresponsive one to use the same process. // the previous page and the unresponsive one to use the same process.
...@@ -296,10 +296,10 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostTest, UnresponsiveCrossSiteNavigation) { ...@@ -296,10 +296,10 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostTest, UnresponsiveCrossSiteNavigation) {
infinite_unload_url, NEW_FOREGROUND_TAB, infinite_unload_url, NEW_FOREGROUND_TAB,
ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
EXPECT_EQ(browser()->tab_count(), 2); EXPECT_EQ(browser()->tab_count(), 2);
tab2 = browser()->GetWebContentsAt(1); web_contents_2 = browser()->GetWebContentsAt(1);
ASSERT_TRUE(tab2 != NULL); ASSERT_TRUE(web_contents_2 != NULL);
EXPECT_EQ(tab2->GetURL(), infinite_unload_url); EXPECT_EQ(web_contents_2->GetURL(), infinite_unload_url);
EXPECT_EQ(rph, tab2->GetRenderProcessHost()); EXPECT_EQ(rph, web_contents_2->GetRenderProcessHost());
process = rph->GetHandle(); process = rph->GetHandle();
ASSERT_TRUE(process); ASSERT_TRUE(process);
...@@ -320,7 +320,7 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostTest, UnresponsiveCrossSiteNavigation) { ...@@ -320,7 +320,7 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostTest, UnresponsiveCrossSiteNavigation) {
// Test that a hung renderer is killed when we are closing the page. // Test that a hung renderer is killed when we are closing the page.
IN_PROC_BROWSER_TEST_F(RenderViewHostTest, UnresponsiveClosePage) { IN_PROC_BROWSER_TEST_F(RenderViewHostTest, UnresponsiveClosePage) {
WebContents* tab = NULL; WebContents* web_contents = NULL;
FilePath doc_root; FilePath doc_root;
doc_root = doc_root.Append(FILE_PATH_LITERAL("content")); doc_root = doc_root.Append(FILE_PATH_LITERAL("content"));
...@@ -346,12 +346,12 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostTest, UnresponsiveClosePage) { ...@@ -346,12 +346,12 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostTest, UnresponsiveClosePage) {
ui_test_utils::NavigateToURLWithDisposition(browser(), ui_test_utils::NavigateToURLWithDisposition(browser(),
infinite_beforeunload_url, NEW_FOREGROUND_TAB, infinite_beforeunload_url, NEW_FOREGROUND_TAB,
ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
tab = browser()->GetWebContentsAt(1); web_contents = browser()->GetWebContentsAt(1);
{ {
ui_test_utils::WindowedNotificationObserver process_exit_observer( ui_test_utils::WindowedNotificationObserver process_exit_observer(
content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
content::NotificationService::AllSources()); content::NotificationService::AllSources());
browser()->CloseTabContents(tab); browser()->CloseTabContents(web_contents);
process_exit_observer.Wait(); process_exit_observer.Wait();
} }
...@@ -360,12 +360,12 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostTest, UnresponsiveClosePage) { ...@@ -360,12 +360,12 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostTest, UnresponsiveClosePage) {
ui_test_utils::NavigateToURLWithDisposition(browser(), ui_test_utils::NavigateToURLWithDisposition(browser(),
infinite_unload_url, NEW_FOREGROUND_TAB, infinite_unload_url, NEW_FOREGROUND_TAB,
ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
tab = browser()->GetWebContentsAt(1); web_contents = browser()->GetWebContentsAt(1);
{ {
ui_test_utils::WindowedNotificationObserver process_exit_observer( ui_test_utils::WindowedNotificationObserver process_exit_observer(
content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
content::NotificationService::AllSources()); content::NotificationService::AllSources());
browser()->CloseTabContents(tab); browser()->CloseTabContents(web_contents);
process_exit_observer.Wait(); process_exit_observer.Wait();
} }
} }
...@@ -138,11 +138,11 @@ static void InitInterstitialPageMap() { ...@@ -138,11 +138,11 @@ static void InitInterstitialPageMap() {
namespace content { namespace content {
InterstitialPage* InterstitialPage::Create(WebContents* tab, InterstitialPage* InterstitialPage::Create(WebContents* web_contents,
bool new_navigation, bool new_navigation,
const GURL& url, const GURL& url,
InterstitialPageDelegate* delegate) { InterstitialPageDelegate* delegate) {
return new InterstitialPageImpl(tab, new_navigation, url, delegate); return new InterstitialPageImpl(web_contents, new_navigation, url, delegate);
} }
InterstitialPage* InterstitialPage::GetInterstitialPage( InterstitialPage* InterstitialPage::GetInterstitialPage(
......
...@@ -346,9 +346,9 @@ WebContentsImpl::~WebContentsImpl() { ...@@ -346,9 +346,9 @@ WebContentsImpl::~WebContentsImpl() {
#endif #endif
// OnCloseStarted isn't called in unit tests. // OnCloseStarted isn't called in unit tests.
if (!tab_close_start_time_.is_null()) { if (!close_start_time_.is_null()) {
UMA_HISTOGRAM_TIMES("Tab.Close", UMA_HISTOGRAM_TIMES("Tab.Close",
base::TimeTicks::Now() - tab_close_start_time_); base::TimeTicks::Now() - close_start_time_);
} }
FOR_EACH_OBSERVER(WebContentsObserver, FOR_EACH_OBSERVER(WebContentsObserver,
...@@ -1250,8 +1250,8 @@ base::TimeTicks WebContentsImpl::GetNewTabStartTime() const { ...@@ -1250,8 +1250,8 @@ base::TimeTicks WebContentsImpl::GetNewTabStartTime() const {
} }
void WebContentsImpl::OnCloseStarted() { void WebContentsImpl::OnCloseStarted() {
if (tab_close_start_time_.is_null()) if (close_start_time_.is_null())
tab_close_start_time_ = base::TimeTicks::Now(); close_start_time_ = base::TimeTicks::Now();
} }
bool WebContentsImpl::ShouldAcceptDragAndDrop() const { bool WebContentsImpl::ShouldAcceptDragAndDrop() const {
...@@ -2584,7 +2584,7 @@ void WebContentsImpl::OnDialogClosed(RenderViewHost* rvh, ...@@ -2584,7 +2584,7 @@ void WebContentsImpl::OnDialogClosed(RenderViewHost* rvh,
// spinning, since we forced it to start spinning in Navigate. // spinning, since we forced it to start spinning in Navigate.
DidStopLoading(); DidStopLoading();
tab_close_start_time_ = base::TimeTicks(); close_start_time_ = base::TimeTicks();
} }
is_showing_before_unload_dialog_ = false; is_showing_before_unload_dialog_ = false;
static_cast<RenderViewHostImpl*>( static_cast<RenderViewHostImpl*>(
......
...@@ -660,8 +660,8 @@ class CONTENT_EXPORT WebContentsImpl ...@@ -660,8 +660,8 @@ class CONTENT_EXPORT WebContentsImpl
// The time that we started to create the new tab page. // The time that we started to create the new tab page.
base::TimeTicks new_tab_start_time_; base::TimeTicks new_tab_start_time_;
// The time that we started to close the tab. // The time that we started to close this WebContents.
base::TimeTicks tab_close_start_time_; base::TimeTicks close_start_time_;
// The time that this tab was last selected. // The time that this tab was last selected.
base::TimeTicks last_selected_time_; base::TimeTicks last_selected_time_;
......
...@@ -84,7 +84,7 @@ WebContentsViewGtk::WebContentsViewGtk( ...@@ -84,7 +84,7 @@ WebContentsViewGtk::WebContentsViewGtk(
: web_contents_(web_contents), : web_contents_(web_contents),
expanded_(gtk_expanded_container_new()), expanded_(gtk_expanded_container_new()),
delegate_(delegate) { delegate_(delegate) {
gtk_widget_set_name(expanded_.get(), "chrome-tab-contents-view"); gtk_widget_set_name(expanded_.get(), "chrome-web-contents-view");
g_signal_connect(expanded_.get(), "size-allocate", g_signal_connect(expanded_.get(), "size-allocate",
G_CALLBACK(OnSizeAllocateThunk), this); G_CALLBACK(OnSizeAllocateThunk), this);
g_signal_connect(expanded_.get(), "child-size-request", g_signal_connect(expanded_.get(), "child-size-request",
......
...@@ -17,7 +17,7 @@ class WebContents; ...@@ -17,7 +17,7 @@ class WebContents;
class ColorChooser { class ColorChooser {
public: public:
static ColorChooser* Create(int identifier, static ColorChooser* Create(int identifier,
WebContents* tab, WebContents* web_contents,
SkColor initial_color); SkColor initial_color);
ColorChooser(int identifier) : identifier_(identifier) {} ColorChooser(int identifier) : identifier_(identifier) {}
virtual ~ColorChooser() {} virtual ~ColorChooser() {}
......
...@@ -34,15 +34,15 @@ class WebContents; ...@@ -34,15 +34,15 @@ class WebContents;
class InterstitialPage { class InterstitialPage {
public: public:
// Creates an interstitial page to show in |tab|. |new_navigation| should be // Creates an interstitial page to show in |web_contents|. |new_navigation|
// set to true when the interstitial is caused by loading a new page, in which // should be set to true when the interstitial is caused by loading a new
// case a temporary navigation entry is created with the URL |url| and added // page, in which case a temporary navigation entry is created with the URL
// to the navigation controller (so the interstitial page appears as a new // |url| and added to the navigation controller (so the interstitial page
// navigation entry). |new_navigation| should be false when the interstitial // appears as a new navigation entry). |new_navigation| should be false when
// was triggered by a loading a sub-resource in a page. Takes ownership of // the interstitial was triggered by a loading a sub-resource in a page. Takes
// |delegate|. // ownership of |delegate|.
CONTENT_EXPORT static InterstitialPage* Create( CONTENT_EXPORT static InterstitialPage* Create(
WebContents* tab, WebContents* web_contents,
bool new_navigation, bool new_navigation,
const GURL& url, const GURL& url,
InterstitialPageDelegate* delegate); InterstitialPageDelegate* delegate);
......
...@@ -50,7 +50,7 @@ struct RendererPreferences; ...@@ -50,7 +50,7 @@ struct RendererPreferences;
// Describes what goes in the main content area of a tab. // Describes what goes in the main content area of a tab.
class WebContents : public PageNavigator { class WebContents : public PageNavigator {
public: public:
// |base_tab_contents| is used if we want to size the new WebContents's view // |base_web_contents| is used if we want to size the new WebContents's view
// based on the view of an existing WebContents. This can be NULL if not // based on the view of an existing WebContents. This can be NULL if not
// needed. // needed.
// //
......
...@@ -44,7 +44,7 @@ bool WebContentsDelegate::ShouldSuppressDialogs() { ...@@ -44,7 +44,7 @@ bool WebContentsDelegate::ShouldSuppressDialogs() {
return false; return false;
} }
void WebContentsDelegate::BeforeUnloadFired(WebContents* tab, void WebContentsDelegate::BeforeUnloadFired(WebContents* web_contents,
bool proceed, bool proceed,
bool* proceed_to_fire_unload) { bool* proceed_to_fire_unload) {
*proceed_to_fire_unload = true; *proceed_to_fire_unload = true;
...@@ -134,18 +134,19 @@ JavaScriptDialogCreator* WebContentsDelegate::GetJavaScriptDialogCreator() { ...@@ -134,18 +134,19 @@ JavaScriptDialogCreator* WebContentsDelegate::GetJavaScriptDialogCreator() {
} }
bool WebContentsDelegate::IsFullscreenForTabOrPending( bool WebContentsDelegate::IsFullscreenForTabOrPending(
const WebContents* tab) const { const WebContents* web_contents) const {
return false; return false;
} }
content::ColorChooser* WebContentsDelegate::OpenColorChooser(WebContents* tab, content::ColorChooser* WebContentsDelegate::OpenColorChooser(
WebContents* web_contents,
int color_chooser_id, int color_chooser_id,
const SkColor& color) { const SkColor& color) {
return NULL; return NULL;
} }
void WebContentsDelegate::WebIntentDispatch( void WebContentsDelegate::WebIntentDispatch(
WebContents* tab, WebContents* web_contents,
WebIntentsDispatcher* intents_dispatcher) { WebIntentsDispatcher* intents_dispatcher) {
// The caller passes this method ownership of the |intents_dispatcher|, but // The caller passes this method ownership of the |intents_dispatcher|, but
// this empty implementation will not use it, so we delete it immediately. // this empty implementation will not use it, so we delete it immediately.
......
...@@ -307,51 +307,52 @@ class CONTENT_EXPORT WebContentsDelegate { ...@@ -307,51 +307,52 @@ class CONTENT_EXPORT WebContentsDelegate {
virtual void WorkerCrashed(WebContents* source) {} virtual void WorkerCrashed(WebContents* source) {}
// Invoked when a main fram navigation occurs. // Invoked when a main fram navigation occurs.
virtual void DidNavigateMainFramePostCommit(WebContents* tab) {} virtual void DidNavigateMainFramePostCommit(WebContents* source) {}
// Invoked when navigating to a pending entry. When invoked the // Invoked when navigating to a pending entry. When invoked the
// NavigationController has configured its pending entry, but it has not yet // NavigationController has configured its pending entry, but it has not yet
// been committed. // been committed.
virtual void DidNavigateToPendingEntry(WebContents* tab) {} virtual void DidNavigateToPendingEntry(WebContents* source) {}
// Returns a pointer to a service to create JavaScript dialogs. May return // Returns a pointer to a service to create JavaScript dialogs. May return
// NULL in which case dialogs aren't shown. // NULL in which case dialogs aren't shown.
virtual JavaScriptDialogCreator* GetJavaScriptDialogCreator(); virtual JavaScriptDialogCreator* GetJavaScriptDialogCreator();
// Called when color chooser should open. Returns the opened color chooser. // Called when color chooser should open. Returns the opened color chooser.
virtual content::ColorChooser* OpenColorChooser(WebContents* tab, virtual content::ColorChooser* OpenColorChooser(WebContents* web_contents,
int color_chooser_id, int color_chooser_id,
const SkColor& color); const SkColor& color);
virtual void DidEndColorChooser() {} virtual void DidEndColorChooser() {}
// Called when a file selection is to be done. // Called when a file selection is to be done.
virtual void RunFileChooser(WebContents* tab, virtual void RunFileChooser(WebContents* web_contents,
const FileChooserParams& params) {} const FileChooserParams& params) {}
// Request to enumerate a directory. This is equivalent to running the file // Request to enumerate a directory. This is equivalent to running the file
// chooser in directory-enumeration mode and having the user select the given // chooser in directory-enumeration mode and having the user select the given
// directory. // directory.
virtual void EnumerateDirectory(WebContents* tab, virtual void EnumerateDirectory(WebContents* web_contents,
int request_id, int request_id,
const FilePath& path) {} const FilePath& path) {}
// Called when the renderer puts a tab into or out of fullscreen mode. // Called when the renderer puts a tab into or out of fullscreen mode.
virtual void ToggleFullscreenModeForTab(WebContents* tab, virtual void ToggleFullscreenModeForTab(WebContents* web_contents,
bool enter_fullscreen) {} bool enter_fullscreen) {}
virtual bool IsFullscreenForTabOrPending(const WebContents* tab) const; virtual bool IsFullscreenForTabOrPending(
const WebContents* web_contents) const;
// Called when a Javascript out of memory notification is received. // Called when a Javascript out of memory notification is received.
virtual void JSOutOfMemory(WebContents* tab) {} virtual void JSOutOfMemory(WebContents* web_contents) {}
// Register a new handler for URL requests with the given scheme. // Register a new handler for URL requests with the given scheme.
virtual void RegisterProtocolHandler(WebContents* tab, virtual void RegisterProtocolHandler(WebContents* web_contents,
const std::string& protocol, const std::string& protocol,
const GURL& url, const GURL& url,
const string16& title) {} const string16& title) {}
// Register a new handler for Intents with the given action and type filter. // Register a new handler for Intents with the given action and type filter.
virtual void RegisterIntentHandler(WebContents* tab, virtual void RegisterIntentHandler(WebContents* web_contents,
const string16& action, const string16& action,
const string16& type, const string16& type,
const string16& href, const string16& href,
...@@ -360,13 +361,13 @@ class CONTENT_EXPORT WebContentsDelegate { ...@@ -360,13 +361,13 @@ class CONTENT_EXPORT WebContentsDelegate {
// Web Intents notification handler. See WebIntentsDispatcher for // Web Intents notification handler. See WebIntentsDispatcher for
// documentation of callee responsibility for the dispatcher. // documentation of callee responsibility for the dispatcher.
virtual void WebIntentDispatch(WebContents* tab, virtual void WebIntentDispatch(WebContents* web_contents,
WebIntentsDispatcher* intents_dispatcher); WebIntentsDispatcher* intents_dispatcher);
// Result of string search in the page. This includes the number of matches // Result of string search in the page. This includes the number of matches
// found and the selection rect (in screen coordinates) for the string found. // found and the selection rect (in screen coordinates) for the string found.
// If |final_update| is false, it indicates that more results follow. // If |final_update| is false, it indicates that more results follow.
virtual void FindReply(WebContents* tab, virtual void FindReply(WebContents* web_contents,
int request_id, int request_id,
int number_of_matches, int number_of_matches,
const gfx::Rect& selection_rect, const gfx::Rect& selection_rect,
...@@ -374,7 +375,8 @@ class CONTENT_EXPORT WebContentsDelegate { ...@@ -374,7 +375,8 @@ class CONTENT_EXPORT WebContentsDelegate {
bool final_update) {} bool final_update) {}
// Notification that a plugin has crashed. // Notification that a plugin has crashed.
virtual void CrashedPlugin(WebContents* tab, const FilePath& plugin_path) {} virtual void CrashedPlugin(WebContents* web_contents,
const FilePath& plugin_path) {}
// Notication that the given plugin has hung or become unhung. This // Notication that the given plugin has hung or become unhung. This
// notification is only for Pepper plugins. // notification is only for Pepper plugins.
...@@ -382,21 +384,21 @@ class CONTENT_EXPORT WebContentsDelegate { ...@@ -382,21 +384,21 @@ class CONTENT_EXPORT WebContentsDelegate {
// The plugin_child_id is the unique child process ID from the plugin. Note // The plugin_child_id is the unique child process ID from the plugin. Note
// that this ID is supplied by the renderer, so should be validated before // that this ID is supplied by the renderer, so should be validated before
// it's used for anything in case there's an exploited renderer. // it's used for anything in case there's an exploited renderer.
virtual void PluginHungStatusChanged(WebContents* tab, virtual void PluginHungStatusChanged(WebContents* web_contents,
int plugin_child_id, int plugin_child_id,
const FilePath& plugin_path, const FilePath& plugin_path,
bool is_hung) {} bool is_hung) {}
// Invoked when the preferred size of the contents has been changed. // Invoked when the preferred size of the contents has been changed.
virtual void UpdatePreferredSize(WebContents* tab, virtual void UpdatePreferredSize(WebContents* web_contents,
const gfx::Size& pref_size) {} const gfx::Size& pref_size) {}
// Invoked when the contents auto-resized and the container should match it. // Invoked when the contents auto-resized and the container should match it.
virtual void ResizeDueToAutoResize(WebContents* tab, virtual void ResizeDueToAutoResize(WebContents* web_contents,
const gfx::Size& new_size) {} const gfx::Size& new_size) {}
// Notification message from HTML UI. // Notification message from HTML UI.
virtual void WebUISend(WebContents* tab, virtual void WebUISend(WebContents* web_contents,
const GURL& source_url, const GURL& source_url,
const std::string& name, const std::string& name,
const base::ListValue& args) {} const base::ListValue& args) {}
...@@ -404,7 +406,7 @@ class CONTENT_EXPORT WebContentsDelegate { ...@@ -404,7 +406,7 @@ class CONTENT_EXPORT WebContentsDelegate {
// Requests to lock the mouse. Once the request is approved or rejected, // Requests to lock the mouse. Once the request is approved or rejected,
// GotResponseToLockMouseRequest() will be called on the requesting tab // GotResponseToLockMouseRequest() will be called on the requesting tab
// contents. // contents.
virtual void RequestToLockMouse(WebContents* tab) {} virtual void RequestToLockMouse(WebContents* web_contents) {}
// Notification that the page has lost the mouse lock. // Notification that the page has lost the mouse lock.
virtual void LostMouseLock() {} virtual void LostMouseLock() {}
......
...@@ -152,8 +152,8 @@ void Shell::WebContentsCreated(WebContents* source_contents, ...@@ -152,8 +152,8 @@ void Shell::WebContentsCreated(WebContents* source_contents,
CreateShell(new_contents); CreateShell(new_contents);
} }
void Shell::DidNavigateMainFramePostCommit(WebContents* tab) { void Shell::DidNavigateMainFramePostCommit(WebContents* web_contents) {
PlatformSetAddressBarURL(tab->GetURL()); PlatformSetAddressBarURL(web_contents->GetURL());
} }
JavaScriptDialogCreator* Shell::GetJavaScriptDialogCreator() { JavaScriptDialogCreator* Shell::GetJavaScriptDialogCreator() {
......
...@@ -120,7 +120,8 @@ class Shell : public WebContentsDelegate, ...@@ -120,7 +120,8 @@ class Shell : public WebContentsDelegate,
int64 source_frame_id, int64 source_frame_id,
const GURL& target_url, const GURL& target_url,
WebContents* new_contents) OVERRIDE; WebContents* new_contents) OVERRIDE;
virtual void DidNavigateMainFramePostCommit(WebContents* tab) OVERRIDE; virtual void DidNavigateMainFramePostCommit(
WebContents* web_contents) OVERRIDE;
virtual JavaScriptDialogCreator* GetJavaScriptDialogCreator() OVERRIDE; virtual JavaScriptDialogCreator* GetJavaScriptDialogCreator() OVERRIDE;
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
virtual void HandleKeyboardEvent( virtual void HandleKeyboardEvent(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment