diff options
Diffstat (limited to 'chrome/renderer')
64 files changed, 358 insertions, 328 deletions
diff --git a/chrome/renderer/autofill/autofill_agent.cc b/chrome/renderer/autofill/autofill_agent.cc index 57e8d1a..c85f6e4 100644 --- a/chrome/renderer/autofill/autofill_agent.cc +++ b/chrome/renderer/autofill/autofill_agent.cc @@ -12,7 +12,7 @@ #include "chrome/common/chrome_constants.h" #include "chrome/renderer/autofill/form_autofill_util.h" #include "chrome/renderer/autofill/password_autofill_manager.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "grit/generated_resources.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormControlElement.h" @@ -48,7 +48,7 @@ const size_t kMaximumTextSizeForAutofill = 1000; namespace autofill { AutofillAgent::AutofillAgent( - RenderView* render_view, + content::RenderView* render_view, PasswordAutofillManager* password_autofill_manager) : content::RenderViewObserver(render_view), password_autofill_manager_(password_autofill_manager), @@ -60,7 +60,7 @@ AutofillAgent::AutofillAgent( suggestions_options_index_(-1), has_shown_autofill_popup_for_current_edit_(false), ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { - render_view->webview()->setAutofillClient(this); + render_view->GetWebView()->setAutofillClient(this); } AutofillAgent::~AutofillAgent() {} @@ -244,7 +244,7 @@ void AutofillAgent::OnSuggestionsReturned(int query_id, const std::vector<string16>& labels, const std::vector<string16>& icons, const std::vector<int>& unique_ids) { - WebKit::WebView* web_view = render_view()->webview(); + WebKit::WebView* web_view = render_view()->GetWebView(); if (!web_view || query_id != autofill_query_id_) return; @@ -329,7 +329,7 @@ void AutofillAgent::OnSuggestionsReturned(int query_id, void AutofillAgent::OnFormDataFilled(int query_id, const webkit_glue::FormData& form) { - if (!render_view()->webview() || query_id != autofill_query_id_) + if (!render_view()->GetWebView() || query_id != autofill_query_id_) return; switch (autofill_action_) { diff --git a/chrome/renderer/autofill/autofill_agent.h b/chrome/renderer/autofill/autofill_agent.h index 2a64196..01644fc 100644 --- a/chrome/renderer/autofill/autofill_agent.h +++ b/chrome/renderer/autofill/autofill_agent.h @@ -45,7 +45,7 @@ class AutofillAgent : public content::RenderViewObserver, public WebKit::WebAutofillClient { public: // PasswordAutofillManager is guaranteed to outlive AutofillAgent. - AutofillAgent(RenderView* render_view, + AutofillAgent(content::RenderView* render_view, PasswordAutofillManager* password_autofill_manager); virtual ~AutofillAgent(); diff --git a/chrome/renderer/autofill/password_autofill_manager.cc b/chrome/renderer/autofill/password_autofill_manager.cc index 63fd4a3..0a0bc53 100644 --- a/chrome/renderer/autofill/password_autofill_manager.cc +++ b/chrome/renderer/autofill/password_autofill_manager.cc @@ -8,7 +8,7 @@ #include "base/memory/scoped_ptr.h" #include "base/message_loop.h" #include "chrome/common/autofill_messages.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h" @@ -202,7 +202,7 @@ namespace autofill { // PasswordAutofillManager, public: PasswordAutofillManager::PasswordAutofillManager( - RenderView* render_view) + content::RenderView* render_view) : content::RenderViewObserver(render_view), ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { } @@ -409,7 +409,7 @@ void PasswordAutofillManager::OnFillPasswordForm( const webkit_glue::PasswordFormFillData& form_data) { FormElementsList forms; // We own the FormElements* in forms. - FindFormElements(render_view()->webview(), form_data.basic_data, &forms); + FindFormElements(render_view()->GetWebView(), form_data.basic_data, &forms); FormElementsList::iterator iter; for (iter = forms.begin(); iter != forms.end(); ++iter) { scoped_ptr<FormElements> form_elements(*iter); diff --git a/chrome/renderer/autofill/password_autofill_manager.h b/chrome/renderer/autofill/password_autofill_manager.h index f03b8b3..bdd91c5 100644 --- a/chrome/renderer/autofill/password_autofill_manager.h +++ b/chrome/renderer/autofill/password_autofill_manager.h @@ -27,7 +27,7 @@ namespace autofill { class PasswordAutofillManager : public content::RenderViewObserver, public PageClickListener { public: - explicit PasswordAutofillManager(RenderView* render_view); + explicit PasswordAutofillManager(content::RenderView* render_view); virtual ~PasswordAutofillManager(); // WebViewClient editor related calls forwarded by the RenderView. diff --git a/chrome/renderer/automation/automation_renderer_helper.cc b/chrome/renderer/automation/automation_renderer_helper.cc index 3eea3fd..28a8b18 100644 --- a/chrome/renderer/automation/automation_renderer_helper.cc +++ b/chrome/renderer/automation/automation_renderer_helper.cc @@ -12,7 +12,8 @@ using WebKit::WebFrame; using WebKit::WebURL; -AutomationRendererHelper::AutomationRendererHelper(RenderView* render_view) +AutomationRendererHelper::AutomationRendererHelper( + content::RenderView* render_view) : content::RenderViewObserver(render_view) { } diff --git a/chrome/renderer/automation/automation_renderer_helper.h b/chrome/renderer/automation/automation_renderer_helper.h index 9f759f6..f83cf4d 100644 --- a/chrome/renderer/automation/automation_renderer_helper.h +++ b/chrome/renderer/automation/automation_renderer_helper.h @@ -17,7 +17,7 @@ class WebURL; // automation/testing messages to the browser. class AutomationRendererHelper : public content::RenderViewObserver { public: - explicit AutomationRendererHelper(RenderView* render_view); + explicit AutomationRendererHelper(content::RenderView* render_view); virtual ~AutomationRendererHelper(); private: diff --git a/chrome/renderer/blocked_plugin.cc b/chrome/renderer/blocked_plugin.cc index 021670b..94d7968 100644 --- a/chrome/renderer/blocked_plugin.cc +++ b/chrome/renderer/blocked_plugin.cc @@ -12,7 +12,7 @@ #include "chrome/renderer/plugin_uma.h" #include "content/common/view_messages.h" #include "content/public/renderer/render_thread.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "grit/generated_resources.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebData.h" @@ -57,7 +57,7 @@ static const unsigned kMenuActionRemove = 2; static const BlockedPlugin* g_last_active_menu; -BlockedPlugin::BlockedPlugin(RenderView* render_view, +BlockedPlugin::BlockedPlugin(content::RenderView* render_view, WebFrame* frame, const webkit::WebPluginInfo& info, const WebPluginParams& params, @@ -150,7 +150,7 @@ void BlockedPlugin::ShowContextMenu(const WebKit::WebMouseEvent& event) { menu_data.customItems.swap(custom_items); menu_data.mousePosition = WebPoint(event.windowX, event.windowY); - render_view()->showContextMenu(NULL, menu_data); + render_view()->ShowContextMenu(NULL, menu_data); g_last_active_menu = this; } @@ -202,7 +202,7 @@ void BlockedPlugin::LoadPlugin() { return; WebPluginContainer* container = plugin_->container(); WebPlugin* new_plugin = - render_view()->CreatePluginInternal(frame_, plugin_info_, plugin_params_); + render_view()->CreatePlugin(frame_, plugin_info_, plugin_params_); if (new_plugin && new_plugin->initialize(container)) { plugin_->RestoreTitleText(); container->setPlugin(new_plugin); @@ -244,7 +244,7 @@ void BlockedPlugin::OpenUrlCallback(const CppArgumentList& args, WebURLRequest request; request.initialize(); request.setURL(url); - render_view()->loadURLExternally( + render_view()->LoadURLExternally( frame_, request, WebKit::WebNavigationPolicyNewForegroundTab); } diff --git a/chrome/renderer/blocked_plugin.h b/chrome/renderer/blocked_plugin.h index ab33dae..c0d3581 100644 --- a/chrome/renderer/blocked_plugin.h +++ b/chrome/renderer/blocked_plugin.h @@ -28,7 +28,7 @@ class BlockedPlugin : public content::RenderViewObserver, public CppBoundClass, public webkit::npapi::WebViewPlugin::Delegate { public: - BlockedPlugin(RenderView* render_view, + BlockedPlugin(content::RenderView* render_view, WebKit::WebFrame* frame, const webkit::WebPluginInfo& info, const WebKit::WebPluginParams& params, diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc index ed92087..af2b36c 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc @@ -59,7 +59,7 @@ #include "chrome/renderer/translate_helper.h" #include "chrome/renderer/visitedlink_slave.h" #include "content/public/renderer/render_thread.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" #include "grit/renderer_resources.h" @@ -220,7 +220,8 @@ void ChromeContentRendererClient::RenderThreadStarted() { WebSecurityPolicy::registerURLSchemeAsSecure(extension_scheme); } -void ChromeContentRendererClient::RenderViewCreated(RenderView* render_view) { +void ChromeContentRendererClient::RenderViewCreated( + content::RenderView* render_view) { ContentSettingsObserver* content_settings = new ContentSettingsObserver(render_view); new ExtensionHelper(render_view, extension_dispatcher_.get()); @@ -268,7 +269,7 @@ std::string ChromeContentRendererClient::GetDefaultEncoding() { } bool ChromeContentRendererClient::OverrideCreatePlugin( - RenderView* render_view, + content::RenderView* render_view, WebFrame* frame, const WebPluginParams& params, WebKit::WebPlugin** plugin) { @@ -277,7 +278,7 @@ bool ChromeContentRendererClient::OverrideCreatePlugin( } WebPlugin* ChromeContentRendererClient::CreatePlugin( - RenderView* render_view, + content::RenderView* render_view, WebFrame* frame, const WebPluginParams& original_params) { CommandLine* cmd = CommandLine::ForCurrentProcess(); @@ -287,7 +288,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( webkit::WebPluginInfo plugin; std::string actual_mime_type; render_view->Send(new ChromeViewHostMsg_GetPluginInfo( - render_view->routing_id(), url, frame->top()->document().url(), + render_view->GetRoutingId(), url, frame->top()->document().url(), orig_mime_type, &status, &plugin, &actual_mime_type)); if (status.value == ChromeViewHostMsg_GetPluginInfo_Status::kNotFound) { @@ -371,7 +372,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( outdated_policy == CONTENT_SETTING_BLOCK) { if (outdated_policy == CONTENT_SETTING_ASK) { render_view->Send(new ChromeViewHostMsg_BlockedOutdatedPlugin( - render_view->routing_id(), group->GetGroupName(), + render_view->GetRoutingId(), group->GetGroupName(), GURL(group->GetUpdateURL()))); } return CreatePluginPlaceholder( @@ -393,7 +394,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( plugin_setting == CONTENT_SETTING_ASK) && host_setting == CONTENT_SETTING_DEFAULT) { render_view->Send(new ChromeViewHostMsg_BlockedOutdatedPlugin( - render_view->routing_id(), group->GetGroupName(), GURL())); + render_view->GetRoutingId(), group->GetGroupName(), GURL())); return CreatePluginPlaceholder( render_view, frame, plugin, params, group.get(), IDR_BLOCKED_PLUGIN_HTML, IDS_PLUGIN_NOT_AUTHORIZED, false, true); @@ -468,7 +469,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( } } - return render_view->CreatePluginInternal(frame, plugin, params); + return render_view->CreatePlugin(frame, plugin, params); } observer->DidBlockContentType(content_type, resource); @@ -486,7 +487,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( } WebPlugin* ChromeContentRendererClient::CreatePluginPlaceholder( - RenderView* render_view, + content::RenderView* render_view, WebFrame* frame, const webkit::WebPluginInfo& plugin, const WebPluginParams& params, @@ -511,7 +512,7 @@ WebPlugin* ChromeContentRendererClient::CreatePluginPlaceholder( frame, plugin, params, - render_view->webkit_preferences(), + render_view->GetWebkitPreferences(), resource_id, name, message, @@ -670,7 +671,7 @@ void ChromeContentRendererClient::PrefetchHostName(const char* hostname, } bool ChromeContentRendererClient::ShouldOverridePageVisibilityState( - const RenderView* render_view, + const content::RenderView* render_view, WebKit::WebPageVisibilityState* override_state) const { if (!prerender::PrerenderHelper::IsPrerendering(render_view)) return false; @@ -680,7 +681,7 @@ bool ChromeContentRendererClient::ShouldOverridePageVisibilityState( } bool ChromeContentRendererClient::HandleGetCookieRequest( - RenderView* sender, + content::RenderView* sender, const GURL& url, const GURL& first_party_for_cookies, std::string* cookies) { @@ -695,7 +696,7 @@ bool ChromeContentRendererClient::HandleGetCookieRequest( } bool ChromeContentRendererClient::HandleSetCookieRequest( - RenderView* sender, + content::RenderView* sender, const GURL& url, const GURL& first_party_for_cookies, const std::string& value) { diff --git a/chrome/renderer/chrome_content_renderer_client.h b/chrome/renderer/chrome_content_renderer_client.h index dca85ff..9bb6cad 100644 --- a/chrome/renderer/chrome_content_renderer_client.h +++ b/chrome/renderer/chrome_content_renderer_client.h @@ -39,12 +39,12 @@ class ChromeContentRendererClient : public content::ContentRendererClient { virtual ~ChromeContentRendererClient(); virtual void RenderThreadStarted() OVERRIDE; - virtual void RenderViewCreated(RenderView* render_view) OVERRIDE; + virtual void RenderViewCreated(content::RenderView* render_view) OVERRIDE; virtual void SetNumberOfViews(int number_of_views) OVERRIDE; virtual SkBitmap* GetSadPluginBitmap() OVERRIDE; virtual std::string GetDefaultEncoding() OVERRIDE; virtual bool OverrideCreatePlugin( - RenderView* render_view, + content::RenderView* render_view, WebKit::WebFrame* frame, const WebKit::WebPluginParams& params, WebKit::WebPlugin** plugin) OVERRIDE; @@ -75,13 +75,13 @@ class ChromeContentRendererClient : public content::ContentRendererClient { virtual bool IsLinkVisited(unsigned long long link_hash) OVERRIDE; virtual void PrefetchHostName(const char* hostname, size_t length) OVERRIDE; virtual bool ShouldOverridePageVisibilityState( - const RenderView* render_view, + const content::RenderView* render_view, WebKit::WebPageVisibilityState* override_state) const OVERRIDE; - virtual bool HandleGetCookieRequest(RenderView* sender, + virtual bool HandleGetCookieRequest(content::RenderView* sender, const GURL& url, const GURL& first_party_for_cookies, std::string* cookies) OVERRIDE; - virtual bool HandleSetCookieRequest(RenderView* sender, + virtual bool HandleSetCookieRequest(content::RenderView* sender, const GURL& url, const GURL& first_party_for_cookies, const std::string& value) OVERRIDE; @@ -96,12 +96,12 @@ class ChromeContentRendererClient : public content::ContentRendererClient { private: WebKit::WebPlugin* CreatePlugin( - RenderView* render_view, + content::RenderView* render_view, WebKit::WebFrame* frame, const WebKit::WebPluginParams& params); WebKit::WebPlugin* CreatePluginPlaceholder( - RenderView* render_view, + content::RenderView* render_view, WebKit::WebFrame* frame, const webkit::WebPluginInfo& plugin, const WebKit::WebPluginParams& params, diff --git a/chrome/renderer/chrome_ppb_pdf_impl.cc b/chrome/renderer/chrome_ppb_pdf_impl.cc index 7df306b..f5f62d3 100644 --- a/chrome/renderer/chrome_ppb_pdf_impl.cc +++ b/chrome/renderer/chrome_ppb_pdf_impl.cc @@ -10,7 +10,7 @@ #include "chrome/common/render_messages.h" #include "content/common/child_process_sandbox_support_linux.h" #include "content/public/renderer/render_thread.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "grit/webkit_resources.h" #include "grit/webkit_strings.h" #include "ppapi/c/pp_resource.h" @@ -326,9 +326,9 @@ void HasUnsupportedFeature(PP_Instance instance_id) { return; WebView* view = instance->container()->element().document().frame()->view(); - RenderView* render_view = RenderView::FromWebView(view); + content::RenderView* render_view = content::RenderView::FromWebView(view); render_view->Send(new ChromeViewHostMsg_PDFHasUnsupportedFeature( - render_view->routing_id())); + render_view->GetRoutingId())); } void SaveAs(PP_Instance instance_id) { diff --git a/chrome/renderer/chrome_render_process_observer.cc b/chrome/renderer/chrome_render_process_observer.cc index 7ef53d5..ddd02b6 100644 --- a/chrome/renderer/chrome_render_process_observer.cc +++ b/chrome/renderer/chrome_render_process_observer.cc @@ -6,6 +6,7 @@ #include "base/command_line.h" #include "base/file_util.h" +#include "base/message_loop.h" #include "base/metrics/field_trial.h" #include "base/metrics/histogram.h" #include "base/native_library.h" @@ -25,7 +26,7 @@ #include "content/common/view_messages.h" #include "content/public/renderer/render_thread.h" #include "content/public/renderer/render_view_visitor.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "crypto/nss_util.h" #include "media/base/media.h" #include "media/base/media_switches.h" @@ -115,8 +116,9 @@ class RenderViewContentSettingsSetter : public content::RenderViewVisitor { content_settings_(content_settings) { } - virtual bool Visit(RenderView* render_view) { - if (GURL(render_view->webview()->mainFrame()->document().url()) == url_) { + virtual bool Visit(content::RenderView* render_view) { + if (GURL(render_view->GetWebView()->mainFrame()->document().url()) == + url_) { ContentSettingsObserver::Get(render_view)->SetContentSettings( content_settings_); } @@ -300,7 +302,7 @@ void ChromeRenderProcessObserver::OnSetContentSettingsForCurrentURL( const GURL& url, const ContentSettings& content_settings) { RenderViewContentSettingsSetter setter(url, content_settings); - RenderView::ForEach(&setter); + content::RenderView::ForEach(&setter); } void ChromeRenderProcessObserver::OnSetDefaultContentSettings( diff --git a/chrome/renderer/chrome_render_view_observer.cc b/chrome/renderer/chrome_render_view_observer.cc index 1716776..b522c63 100644 --- a/chrome/renderer/chrome_render_view_observer.cc +++ b/chrome/renderer/chrome_render_view_observer.cc @@ -213,7 +213,7 @@ GURL StripRef(const GURL& url) { } // namespace ChromeRenderViewObserver::ChromeRenderViewObserver( - RenderView* render_view, + content::RenderView* render_view, ContentSettingsObserver* content_settings, ChromeRenderProcessObserver* chrome_render_process_observer, ExtensionDispatcher* extension_dispatcher, @@ -230,11 +230,11 @@ ChromeRenderViewObserver::ChromeRenderViewObserver( ALLOW_THIS_IN_INITIALIZER_LIST(page_info_method_factory_(this)) { const CommandLine& command_line = *CommandLine::ForCurrentProcess(); if (command_line.HasSwitch(switches::kDomAutomationController)) { - int old_bindings = render_view->enabled_bindings(); - render_view->set_enabled_bindings( + int old_bindings = render_view->GetEnabledBindings(); + render_view->SetEnabledBindings( old_bindings |= BindingsPolicy::DOM_AUTOMATION); } - render_view->webview()->setPermissionClient(this); + render_view->GetWebView()->setPermissionClient(this); if (!command_line.HasSwitch(switches::kDisableClientSidePhishingDetection)) OnSetClientSidePhishingDetection(true); } @@ -289,11 +289,11 @@ void ChromeRenderViewObserver::OnCaptureSnapshot() { SkBitmap snapshot; bool error = false; - WebFrame* main_frame = render_view()->webview()->mainFrame(); + WebFrame* main_frame = render_view()->GetWebView()->mainFrame(); if (!main_frame) error = true; - if (!error && !CaptureSnapshot(render_view()->webview(), &snapshot)) + if (!error && !CaptureSnapshot(render_view()->GetWebView(), &snapshot)) error = true; DCHECK(error == snapshot.empty()) << @@ -344,7 +344,7 @@ void ChromeRenderViewObserver::OnDownloadFavicon(int id, void ChromeRenderViewObserver::OnSetAllowDisplayingInsecureContent(bool allow) { allow_displaying_insecure_content_ = allow; - WebFrame* main_frame = render_view()->webview()->mainFrame(); + WebFrame* main_frame = render_view()->GetWebView()->mainFrame(); if (main_frame) main_frame->reload(); } @@ -377,8 +377,8 @@ void ChromeRenderViewObserver::OnStartFrameSniffer(const string16& frame_name) { } void ChromeRenderViewObserver::OnGetFPS() { - float fps = (render_view()->filtered_time_per_frame() > 0.0f)? - 1.0f / render_view()->filtered_time_per_frame() : 0.0f; + float fps = (render_view()->GetFilteredTimePerFrame() > 0.0f)? + 1.0f / render_view()->GetFilteredTimePerFrame() : 0.0f; Send(new ChromeViewHostMsg_FPS(routing_id(), fps)); } @@ -664,7 +664,7 @@ void ChromeRenderViewObserver::OnSetIsPrerendering(bool is_prerendering) { } void ChromeRenderViewObserver::DidStartLoading() { - if (BindingsPolicy::is_web_ui_enabled(render_view()->enabled_bindings()) && + if (BindingsPolicy::is_web_ui_enabled(render_view()->GetEnabledBindings()) && webui_javascript_.get()) { render_view()->EvaluateScript(webui_javascript_->frame_xpath, webui_javascript_->jscript, @@ -677,15 +677,16 @@ void ChromeRenderViewObserver::DidStopLoading() { MessageLoop::current()->PostDelayedTask( FROM_HERE, page_info_method_factory_.NewRunnableMethod( - &ChromeRenderViewObserver::CapturePageInfo, render_view()->page_id(), + &ChromeRenderViewObserver::CapturePageInfo, + render_view()->GetPageId(), false), - render_view()->content_state_immediately() ? 0 : kDelayForCaptureMs); + render_view()->GetContentStateImmediately() ? 0 : kDelayForCaptureMs); - WebFrame* main_frame = render_view()->webview()->mainFrame(); + WebFrame* main_frame = render_view()->GetWebView()->mainFrame(); GURL osd_url = main_frame->document().openSearchDescriptionURL(); if (!osd_url.is_empty()) { Send(new ChromeViewHostMsg_PageHasOSDD( - routing_id(), render_view()->page_id(), osd_url, + routing_id(), render_view()->GetPageId(), osd_url, search_provider::AUTODETECTED_PROVIDER)); } @@ -694,7 +695,7 @@ void ChromeRenderViewObserver::DidStopLoading() { icon_types |= WebIconURL::TypeTouchPrecomposed | WebIconURL::TypeTouch; WebVector<WebIconURL> icon_urls = - render_view()->webview()->mainFrame()->iconURLs(icon_types); + render_view()->GetWebView()->mainFrame()->iconURLs(icon_types); std::vector<FaviconURL> urls; for (size_t i = 0; i < icon_urls.size(); i++) { WebURL url = icon_urls[i].iconURL(); @@ -703,7 +704,7 @@ void ChromeRenderViewObserver::DidStopLoading() { } if (!urls.empty()) { Send(new IconHostMsg_UpdateFaviconURL( - routing_id(), render_view()->page_id(), urls)); + routing_id(), render_view()->GetPageId(), urls)); } } @@ -723,7 +724,7 @@ void ChromeRenderViewObserver::DidChangeIcon(WebFrame* frame, ToFaviconType(icon_urls[i].iconType()))); } Send(new IconHostMsg_UpdateFaviconURL( - routing_id(), render_view()->page_id(), urls)); + routing_id(), render_view()->GetPageId(), urls)); } void ChromeRenderViewObserver::DidCommitProvisionalLoad( @@ -734,19 +735,20 @@ void ChromeRenderViewObserver::DidCommitProvisionalLoad( MessageLoop::current()->PostDelayedTask( FROM_HERE, page_info_method_factory_.NewRunnableMethod( - &ChromeRenderViewObserver::CapturePageInfo, render_view()->page_id(), + &ChromeRenderViewObserver::CapturePageInfo, + render_view()->GetPageId(), true), kDelayForForcedCaptureMs); } void ChromeRenderViewObserver::DidClearWindowObject(WebFrame* frame) { if (BindingsPolicy::is_dom_automation_enabled( - render_view()->enabled_bindings())) { + render_view()->GetEnabledBindings())) { BindDOMAutomationController(frame); } if (BindingsPolicy::is_external_host_enabled( - render_view()->enabled_bindings())) { + render_view()->GetEnabledBindings())) { GetExternalHostBindings()->BindToJavascript(frame, "externalHost"); } } @@ -760,13 +762,15 @@ void ChromeRenderViewObserver::DidHandleTouchEvent(const WebTouchEvent& event) { // Ignore the case of multiple touches if (event.touchesLength != 1) return; - if (render_view()->webview()->textInputType() == WebKit::WebTextInputTypeNone) + if (render_view()->GetWebView()->textInputType() == + WebKit::WebTextInputTypeNone) { return; + } WebKit::WebNode node = render_view()->GetFocusedNode(); if (node.isNull()) return; WebKit::WebAccessibilityObject accessibility = - render_view()->webview()->accessibilityObject(); + render_view()->GetWebView()->accessibilityObject(); if (accessibility.isNull()) return; const WebKit::WebTouchPoint point = event.touches[0]; @@ -775,12 +779,12 @@ void ChromeRenderViewObserver::DidHandleTouchEvent(const WebTouchEvent& event) { return; if (accessibility.node() == node) render_view()->Send(new ChromeViewHostMsg_FocusedEditableNodeTouched( - render_view()->routing_id())); + render_view()->GetRoutingId())); } void ChromeRenderViewObserver::CapturePageInfo(int load_id, bool preliminary_capture) { - if (load_id != render_view()->page_id()) + if (load_id != render_view()->GetPageId()) return; // This capture call is no longer relevant due to navigation. // Skip indexing if this is not a new load. Note that the case where @@ -790,10 +794,10 @@ void ChromeRenderViewObserver::CapturePageInfo(int load_id, if (load_id < last_indexed_page_id_) return; - if (!render_view()->webview()) + if (!render_view()->GetWebView()) return; - WebFrame* main_frame = render_view()->webview()->mainFrame(); + WebFrame* main_frame = render_view()->GetWebView()->mainFrame(); if (!main_frame) return; @@ -894,7 +898,7 @@ void ChromeRenderViewObserver::CaptureText(WebFrame* frame, } void ChromeRenderViewObserver::CaptureThumbnail() { - WebFrame* main_frame = render_view()->webview()->mainFrame(); + WebFrame* main_frame = render_view()->GetWebView()->mainFrame(); if (!main_frame) return; @@ -903,12 +907,12 @@ void ChromeRenderViewObserver::CaptureThumbnail() { if (url.is_empty()) return; - if (render_view()->size().IsEmpty()) + if (render_view()->GetSize().IsEmpty()) return; // Don't create an empty thumbnail! ThumbnailScore score; SkBitmap thumbnail; - if (!CaptureFrameThumbnail(render_view()->webview(), kThumbnailWidth, + if (!CaptureFrameThumbnail(render_view()->GetWebView(), kThumbnailWidth, kThumbnailHeight, &thumbnail, &score)) return; @@ -1027,12 +1031,12 @@ bool ChromeRenderViewObserver::DownloadFavicon(int id, const GURL& image_url, int image_size) { // Make sure webview was not shut down. - if (!render_view()->webview()) + if (!render_view()->GetWebView()) return false; // Create an image resource fetcher and assign it with a call back object. image_fetchers_.push_back(linked_ptr<ImageResourceFetcher>( new ImageResourceFetcher( - image_url, render_view()->webview()->mainFrame(), id, image_size, + image_url, render_view()->GetWebView()->mainFrame(), id, image_size, WebURLRequest::TargetIsFavicon, NewCallback(this, &ChromeRenderViewObserver::DidDownloadFavicon)))); return true; @@ -1049,7 +1053,7 @@ void ChromeRenderViewObserver::DidDownloadFavicon( // Remove the image fetcher from our pending list. We're in the callback from // ImageResourceFetcher, best to delay deletion. - RenderView::ImageResourceFetcherList::iterator iter; + ImageResourceFetcherList::iterator iter; for (iter = image_fetchers_.begin(); iter != image_fetchers_.end(); ++iter) { if (iter->get() == fetcher) { iter->release(); diff --git a/chrome/renderer/chrome_render_view_observer.h b/chrome/renderer/chrome_render_view_observer.h index d09c35c..60afcfe 100644 --- a/chrome/renderer/chrome_render_view_observer.h +++ b/chrome/renderer/chrome_render_view_observer.h @@ -9,6 +9,7 @@ #include <string> #include <vector> +#include "base/memory/linked_ptr.h" #include "base/memory/scoped_ptr.h" #include "base/task.h" #include "content/public/renderer/render_view_observer.h" @@ -42,7 +43,7 @@ class ChromeRenderViewObserver : public content::RenderViewObserver, public: // translate_helper can be NULL. ChromeRenderViewObserver( - RenderView* render_view, + content::RenderView* render_view, ContentSettingsObserver* content_settings, ChromeRenderProcessObserver* chrome_render_process_observer, ExtensionDispatcher* extension_dispatcher, @@ -205,8 +206,11 @@ class ChromeRenderViewObserver : public content::RenderViewObserver, ScopedRunnableMethodFactory<ChromeRenderViewObserver> page_info_method_factory_; + typedef std::vector<linked_ptr<webkit_glue::ImageResourceFetcher> > + ImageResourceFetcherList; + // ImageResourceFetchers schedule via DownloadImage. - RenderView::ImageResourceFetcherList image_fetchers_; + ImageResourceFetcherList image_fetchers_; DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewObserver); }; diff --git a/chrome/renderer/content_settings_observer.cc b/chrome/renderer/content_settings_observer.cc index cac0470..5a97812 100644 --- a/chrome/renderer/content_settings_observer.cc +++ b/chrome/renderer/content_settings_observer.cc @@ -9,7 +9,7 @@ #include "content/common/database_messages.h" #include "content/common/view_messages.h" #include "content/public/renderer/navigation_state.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" @@ -56,7 +56,8 @@ static bool IsWhitelistedForContentSettings(WebFrame* frame) { ContentSettings ContentSettingsObserver::default_settings_; -ContentSettingsObserver::ContentSettingsObserver(RenderView* render_view) +ContentSettingsObserver::ContentSettingsObserver( + content::RenderView* render_view) : content::RenderViewObserver(render_view), content::RenderViewObserverTracker<ContentSettingsObserver>(render_view), plugins_temporarily_allowed_(false) { @@ -162,7 +163,8 @@ void ContentSettingsObserver::DidCommitProvisionalLoad( // The opener's view is not guaranteed to be non-null (it could be // detached from its page but not yet destructed). if (WebView* opener_view = frame->opener()->view()) { - RenderView* opener = RenderView::FromWebView(opener_view); + content::RenderView* opener = + content::RenderView::FromWebView(opener_view); ContentSettingsObserver* observer = ContentSettingsObserver::Get(opener); SetContentSettings(observer->current_content_settings_); } diff --git a/chrome/renderer/content_settings_observer.h b/chrome/renderer/content_settings_observer.h index 56e1164..afe0bb9e 100644 --- a/chrome/renderer/content_settings_observer.h +++ b/chrome/renderer/content_settings_observer.h @@ -24,7 +24,7 @@ class ContentSettingsObserver : public content::RenderViewObserver, public content::RenderViewObserverTracker<ContentSettingsObserver> { public: - explicit ContentSettingsObserver(RenderView* render_view); + explicit ContentSettingsObserver(content::RenderView* render_view); virtual ~ContentSettingsObserver(); // Sets the content settings that back allowScripts(), allowImages(), and diff --git a/chrome/renderer/extensions/chrome_app_bindings.cc b/chrome/renderer/extensions/chrome_app_bindings.cc index db0fb36..7f2788b 100644 --- a/chrome/renderer/extensions/chrome_app_bindings.cc +++ b/chrome/renderer/extensions/chrome_app_bindings.cc @@ -15,8 +15,8 @@ #include "chrome/renderer/extensions/extension_dispatcher.h" #include "chrome/renderer/extensions/extension_helper.h" #include "chrome/renderer/weak_v8_function_map.h" +#include "content/public/renderer/render_view.h" #include "content/public/renderer/v8_value_converter.h" -#include "content/renderer/render_view.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "v8/include/v8.h" @@ -139,7 +139,8 @@ class ChromeAppExtensionWrapper : public v8::Extension { if (!frame || !frame->view()) return v8::Undefined(); - RenderView* render_view = RenderView::FromWebView(frame->view()); + content::RenderView* render_view = + content::RenderView::FromWebView(frame->view()); if (!render_view) return v8::Undefined(); @@ -200,7 +201,8 @@ class ChromeAppExtensionWrapper : public v8::Extension { if (!frame || !frame->view()) return v8::Undefined(); - RenderView* render_view = RenderView::FromWebView(frame->view()); + content::RenderView* render_view = + content::RenderView::FromWebView(frame->view()); if (!render_view) return v8::Undefined(); diff --git a/chrome/renderer/extensions/chrome_v8_context.cc b/chrome/renderer/extensions/chrome_v8_context.cc index d3cc655..bd6b604 100644 --- a/chrome/renderer/extensions/chrome_v8_context.cc +++ b/chrome/renderer/extensions/chrome_v8_context.cc @@ -9,7 +9,7 @@ #include "base/values.h" #include "chrome/common/extensions/extension_set.h" #include "chrome/renderer/extensions/chrome_v8_extension.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" #include "v8/include/v8.h" @@ -31,9 +31,9 @@ ChromeV8Context::~ChromeV8Context() { v8_context_.Dispose(); } -RenderView* ChromeV8Context::GetRenderView() const { +content::RenderView* ChromeV8Context::GetRenderView() const { if (web_frame_ && web_frame_->view()) - return RenderView::FromWebView(web_frame_->view()); + return content::RenderView::FromWebView(web_frame_->view()); else return NULL; } diff --git a/chrome/renderer/extensions/chrome_v8_context.h b/chrome/renderer/extensions/chrome_v8_context.h index f55fc54..750a3b3 100644 --- a/chrome/renderer/extensions/chrome_v8_context.h +++ b/chrome/renderer/extensions/chrome_v8_context.h @@ -11,15 +11,17 @@ #include "base/basictypes.h" #include "v8/include/v8.h" -namespace base { -class ListValue; -} - namespace WebKit { class WebFrame; } +namespace base { +class ListValue; +} + +namespace content { class RenderView; +} // Chrome's wrapper for a v8 context. class ChromeV8Context { @@ -46,7 +48,7 @@ class ChromeV8Context { // Returns the RenderView associated with this context. Can return NULL if the // context is in the process of being destroyed. - RenderView* GetRenderView() const; + content::RenderView* GetRenderView() const; // Fires the onload and onunload events on the chromeHidden object. // TODO(aa): Does these make more sense with EventBindings? diff --git a/chrome/renderer/extensions/chrome_v8_context_set.cc b/chrome/renderer/extensions/chrome_v8_context_set.cc index a670704..ab37045 100644 --- a/chrome/renderer/extensions/chrome_v8_context_set.cc +++ b/chrome/renderer/extensions/chrome_v8_context_set.cc @@ -12,7 +12,7 @@ #include "chrome/renderer/extensions/chrome_v8_context.h" #include "content/public/renderer/render_thread.h" #include "content/public/renderer/v8_value_converter.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "v8/include/v8.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" @@ -30,7 +30,8 @@ namespace { // // TODO(aa): This looks super suspicious. Is it correct? Can we use something // else already in the system? Should it be moved elsewhere? -bool HasSufficientPermissions(RenderView* render_view, const GURL& event_url) { + bool HasSufficientPermissions(content::RenderView* render_view, + const GURL& event_url) { // During unit tests, we might be invoked without a v8 context. In these // cases, we only allow empty event_urls and short-circuit before retrieving // the render view from the current context. @@ -38,7 +39,7 @@ bool HasSufficientPermissions(RenderView* render_view, const GURL& event_url) { return true; WebKit::WebDocument document = - render_view->webview()->mainFrame()->document(); + render_view->GetWebView()->mainFrame()->document(); return GURL(document.url()).SchemeIs(chrome::kExtensionScheme) && document.securityOrigin().canRequest(event_url); } @@ -102,7 +103,7 @@ void ChromeV8ContextSet::DispatchChromeHiddenMethod( const std::string& extension_id, const std::string& method_name, const base::ListValue& arguments, - RenderView* render_view, + content::RenderView* render_view, const GURL& event_url) const { v8::HandleScope handle_scope; @@ -119,7 +120,7 @@ void ChromeV8ContextSet::DispatchChromeHiddenMethod( if (!extension_id.empty() && extension_id != (*it)->extension_id()) continue; - RenderView* context_render_view = (*it)->GetRenderView(); + content::RenderView* context_render_view = (*it)->GetRenderView(); if (!context_render_view) continue; diff --git a/chrome/renderer/extensions/chrome_v8_context_set.h b/chrome/renderer/extensions/chrome_v8_context_set.h index 37293c6..4ae66ed 100644 --- a/chrome/renderer/extensions/chrome_v8_context_set.h +++ b/chrome/renderer/extensions/chrome_v8_context_set.h @@ -14,12 +14,15 @@ class ChromeV8Context; class GURL; -class RenderView; namespace base { class ListValue; } +namespace content { +class RenderView; +} + namespace v8 { class Context; } @@ -66,7 +69,7 @@ class ChromeV8ContextSet { void DispatchChromeHiddenMethod(const std::string& extension_id, const std::string& method_name, const base::ListValue& arguments, - RenderView* render_view, + content::RenderView* render_view, const GURL& event_url) const; private: diff --git a/chrome/renderer/extensions/chrome_v8_extension.cc b/chrome/renderer/extensions/chrome_v8_extension.cc index e4e254a..ca92f67 100644 --- a/chrome/renderer/extensions/chrome_v8_extension.cc +++ b/chrome/renderer/extensions/chrome_v8_extension.cc @@ -11,7 +11,7 @@ #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_set.h" #include "chrome/renderer/extensions/extension_dispatcher.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" @@ -48,7 +48,7 @@ const char* ChromeV8Extension::GetStringResource(int resource_id) { } // static -RenderView* ChromeV8Extension::GetCurrentRenderView() { +content::RenderView* ChromeV8Extension::GetCurrentRenderView() { WebFrame* webframe = WebFrame::frameForCurrentContext(); DCHECK(webframe) << "RetrieveCurrentFrame called when not in a V8 context."; if (!webframe) @@ -58,7 +58,7 @@ RenderView* ChromeV8Extension::GetCurrentRenderView() { if (!webview) return NULL; // can happen during closing - RenderView* renderview = RenderView::FromWebView(webview); + content::RenderView* renderview = content::RenderView::FromWebView(webview); DCHECK(renderview) << "Encountered a WebView without a WebViewDelegate"; return renderview; } @@ -84,11 +84,11 @@ ChromeV8Extension::ChromeV8Extension(const char* name, int resource_id, } const Extension* ChromeV8Extension::GetExtensionForCurrentRenderView() const { - RenderView* renderview = GetCurrentRenderView(); + content::RenderView* renderview = GetCurrentRenderView(); if (!renderview) return NULL; // this can happen as a tab is closing. - GURL url = renderview->webview()->mainFrame()->document().url(); + GURL url = renderview->GetWebView()->mainFrame()->document().url(); const ExtensionSet* extensions = extension_dispatcher_->extensions(); if (!extensions->ExtensionBindingsAllowed(url)) return NULL; diff --git a/chrome/renderer/extensions/chrome_v8_extension.h b/chrome/renderer/extensions/chrome_v8_extension.h index d635a63..54665e4 100644 --- a/chrome/renderer/extensions/chrome_v8_extension.h +++ b/chrome/renderer/extensions/chrome_v8_extension.h @@ -13,12 +13,15 @@ class Extension; class ExtensionDispatcher; -class RenderView; namespace WebKit { class WebFrame; } +namespace content { +class RenderView; +} + // This is a base class for chrome extension bindings. Common features that // are shared by different modules go here. // @@ -58,7 +61,7 @@ class ChromeV8Extension : public v8::Extension { } // Gets the render view for the current v8 context. - static RenderView* GetCurrentRenderView(); + static content::RenderView* GetCurrentRenderView(); // Note: do not call this function before or during the chromeHidden.onLoad // event dispatch. The URL might not have been committed yet and might not diff --git a/chrome/renderer/extensions/chrome_webstore_bindings.cc b/chrome/renderer/extensions/chrome_webstore_bindings.cc index 56bb4b9..d5e0a6c 100644 --- a/chrome/renderer/extensions/chrome_webstore_bindings.cc +++ b/chrome/renderer/extensions/chrome_webstore_bindings.cc @@ -9,7 +9,7 @@ #include "chrome/common/extensions/extension.h" #include "chrome/renderer/extensions/extension_helper.h" #include "chrome/renderer/weak_v8_function_map.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "googleurl/src/gurl.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" @@ -85,7 +85,8 @@ class ExtensionImpl : public v8::Extension { if (!frame || !frame->view()) return v8::Undefined(); - RenderView* render_view = RenderView::FromWebView(frame->view()); + content::RenderView* render_view = + content::RenderView::FromWebView(frame->view()); if (!render_view) return v8::Undefined(); diff --git a/chrome/renderer/extensions/event_bindings.cc b/chrome/renderer/extensions/event_bindings.cc index 194020a..58b5cc2 100644 --- a/chrome/renderer/extensions/event_bindings.cc +++ b/chrome/renderer/extensions/event_bindings.cc @@ -20,7 +20,6 @@ #include "chrome/renderer/extensions/extension_process_bindings.h" #include "chrome/renderer/extensions/user_script_slave.h" #include "content/public/renderer/render_thread.h" -#include "content/renderer/render_view.h" #include "googleurl/src/gurl.h" #include "grit/renderer_resources.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" diff --git a/chrome/renderer/extensions/extension_helper.cc b/chrome/renderer/extensions/extension_helper.cc index 917257f..b2123bb 100644 --- a/chrome/renderer/extensions/extension_helper.cc +++ b/chrome/renderer/extensions/extension_helper.cc @@ -23,7 +23,7 @@ #include "chrome/renderer/extensions/renderer_extension_bindings.h" #include "chrome/renderer/extensions/user_script_idle_scheduler.h" #include "chrome/renderer/extensions/user_script_slave.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" @@ -49,7 +49,7 @@ typedef std::map<WebFrame*, UserScriptIdleScheduler*> SchedulerMap; static base::LazyInstance<SchedulerMap> g_schedulers(base::LINKER_INITIALIZED); } -ExtensionHelper::ExtensionHelper(RenderView* render_view, +ExtensionHelper::ExtensionHelper(content::RenderView* render_view, ExtensionDispatcher* extension_dispatcher) : content::RenderViewObserver(render_view), content::RenderViewObserverTracker<ExtensionHelper>(render_view), @@ -102,7 +102,7 @@ bool ExtensionHelper::InstallWebApplicationUsingDefinitionFile( } app_definition_fetcher_.reset(new ResourceFetcher( - pending_app_info_->manifest_url, render_view()->webview()->mainFrame(), + pending_app_info_->manifest_url, render_view()->GetWebView()->mainFrame(), WebURLRequest::TargetIsSubresource, NewCallback(this, &ExtensionHelper::DidDownloadApplicationDefinition))); return true; @@ -237,7 +237,7 @@ void ExtensionHelper::OnExtensionDeliverMessage(int target_id, void ExtensionHelper::OnExecuteCode( const ExtensionMsg_ExecuteCode_Params& params) { - WebView* webview = render_view()->webview(); + WebView* webview = render_view()->GetWebView(); WebFrame* main_frame = webview->mainFrame(); if (!main_frame) { Send(new ExtensionHostMsg_ExecuteCodeFinished( @@ -254,10 +254,10 @@ void ExtensionHelper::OnExecuteCode( void ExtensionHelper::OnGetApplicationInfo(int page_id) { WebApplicationInfo app_info; - if (page_id == render_view()->page_id()) { + if (page_id == render_view()->GetPageId()) { string16 error; web_apps::ParseWebAppFromWebDocument( - render_view()->webview()->mainFrame(), &app_info, &error); + render_view()->GetWebView()->mainFrame(), &app_info, &error); } // Prune out any data URLs in the set of icons. The browser process expects @@ -313,7 +313,7 @@ void ExtensionHelper::DidDownloadApplicationDefinition( app_icon_fetchers_.push_back(linked_ptr<ImageResourceFetcher>( new ImageResourceFetcher( pending_app_info_->icons[i].url, - render_view()->webview()->mainFrame(), + render_view()->GetWebView()->mainFrame(), static_cast<int>(i), pending_app_info_->icons[i].width, WebURLRequest::TargetIsFavicon, @@ -331,7 +331,7 @@ void ExtensionHelper::DidDownloadApplicationIcon(ImageResourceFetcher* fetcher, // Remove the image fetcher from our pending list. We're in the callback from // ImageResourceFetcher, best to delay deletion. - RenderView::ImageResourceFetcherList::iterator i; + ImageResourceFetcherList::iterator i; for (i = app_icon_fetchers_.begin(); i != app_icon_fetchers_.end(); ++i) { if (i->get() == fetcher) { i->release(); @@ -376,8 +376,8 @@ void ExtensionHelper::DidDownloadApplicationIcon(ImageResourceFetcher* fetcher, } void ExtensionHelper::AddErrorToRootConsole(const string16& message) { - if (render_view()->webview() && render_view()->webview()->mainFrame()) { - render_view()->webview()->mainFrame()->addMessageToConsole( + if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) { + render_view()->GetWebView()->mainFrame()->addMessageToConsole( WebConsoleMessage(WebConsoleMessage::LevelError, message)); } } diff --git a/chrome/renderer/extensions/extension_helper.h b/chrome/renderer/extensions/extension_helper.h index 1086a31..fb2bc7d 100644 --- a/chrome/renderer/extensions/extension_helper.h +++ b/chrome/renderer/extensions/extension_helper.h @@ -7,14 +7,18 @@ #pragma once #include <map> +#include <vector> +#include "base/memory/linked_ptr.h" +#include "base/memory/scoped_ptr.h" #include "content/public/renderer/render_view_observer.h" #include "content/public/renderer/render_view_observer_tracker.h" #include "content/common/view_types.h" -#include "content/renderer/render_view.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" class ExtensionDispatcher; class GURL; +class SkBitmap; struct ExtensionMsg_ExecuteCode_Params; struct WebApplicationInfo; @@ -24,6 +28,7 @@ class ListValue; namespace webkit_glue { class ResourceFetcher; +class ImageResourceFetcher; } // RenderView-level plumbing for extension features. @@ -31,7 +36,7 @@ class ExtensionHelper : public content::RenderViewObserver, public content::RenderViewObserverTracker<ExtensionHelper> { public: - ExtensionHelper(RenderView* render_view, + ExtensionHelper(content::RenderView* render_view, ExtensionDispatcher* extension_dispatcher); virtual ~ExtensionHelper(); @@ -108,7 +113,9 @@ class ExtensionHelper scoped_ptr<webkit_glue::ResourceFetcher> app_definition_fetcher_; // Used to download the icons for an application. - RenderView::ImageResourceFetcherList app_icon_fetchers_; + typedef std::vector<linked_ptr<webkit_glue::ImageResourceFetcher> > + ImageResourceFetcherList; + ImageResourceFetcherList app_icon_fetchers_; // The number of app icon requests outstanding. When this reaches zero, we're // done processing an app definition file. diff --git a/chrome/renderer/extensions/extension_process_bindings.cc b/chrome/renderer/extensions/extension_process_bindings.cc index 10b2890..5be5611 100644 --- a/chrome/renderer/extensions/extension_process_bindings.cc +++ b/chrome/renderer/extensions/extension_process_bindings.cc @@ -26,6 +26,7 @@ #include "chrome/common/render_messages.h" #include "chrome/common/url_constants.h" #include "chrome/common/chrome_view_types.h" +#include "content/public/renderer/render_view.h" #include "content/public/renderer/render_view_visitor.h" #include "chrome/renderer/chrome_render_process_observer.h" #include "chrome/renderer/extensions/chrome_v8_context.h" @@ -37,7 +38,7 @@ #include "chrome/renderer/extensions/renderer_extension_bindings.h" #include "chrome/renderer/extensions/user_script_slave.h" #include "chrome/renderer/static_v8_external_string_resource.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "grit/common_resources.h" #include "grit/renderer_resources.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebBlob.h" @@ -94,12 +95,12 @@ class ExtensionViewAccumulator : public content::RenderViewVisitor { v8::Local<v8::Array> views() { return views_; } - virtual bool Visit(RenderView* render_view) { + virtual bool Visit(content::RenderView* render_view) { ExtensionHelper* helper = ExtensionHelper::Get(render_view); if (!ViewTypeMatches(helper->view_type(), view_type_)) return true; - GURL url = render_view->webview()->mainFrame()->document().url(); + GURL url = render_view->GetWebView()->mainFrame()->document().url(); if (!url.SchemeIs(chrome::kExtensionScheme)) return true; const std::string& extension_id = url.host(); @@ -112,7 +113,7 @@ class ExtensionViewAccumulator : public content::RenderViewVisitor { } v8::Local<v8::Context> context = - render_view->webview()->mainFrame()->mainWorldScriptContext(); + render_view->GetWebView()->mainFrame()->mainWorldScriptContext(); if (!context.IsEmpty()) { v8::Local<v8::Value> window = context->Global(); DCHECK(!window.IsEmpty()); @@ -255,7 +256,7 @@ class ExtensionImpl : public ChromeV8Extension { ExtensionViewAccumulator accumulator(extension->id(), browser_window_id, view_type); - RenderView::ForEach(&accumulator); + content::RenderView::ForEach(&accumulator); return accumulator.views(); } @@ -375,7 +376,7 @@ class ExtensionImpl : public ChromeV8Extension { static v8::Handle<v8::Value> OpenChannelToTab(const v8::Arguments& args) { // Get the current RenderView so that we can send a routed IPC message from // the correct source. - RenderView* renderview = GetCurrentRenderView(); + content::RenderView* renderview = GetCurrentRenderView(); if (!renderview) return v8::Undefined(); @@ -386,7 +387,7 @@ class ExtensionImpl : public ChromeV8Extension { std::string channel_name = *v8::String::Utf8Value(args[2]->ToString()); int port_id = -1; renderview->Send(new ExtensionHostMsg_OpenChannelToTab( - renderview->routing_id(), tab_id, extension_id, channel_name, + renderview->GetRoutingId(), tab_id, extension_id, channel_name, &port_id)); return v8::Integer::New(port_id); } @@ -438,7 +439,7 @@ class ExtensionImpl : public ChromeV8Extension { // Get the current RenderView so that we can send a routed IPC message from // the correct source. - RenderView* renderview = GetCurrentRenderView(); + content::RenderView* renderview = GetCurrentRenderView(); if (!renderview) return v8::Undefined(); @@ -478,10 +479,10 @@ class ExtensionImpl : public ChromeV8Extension { webframe ? webframe->isProcessingUserGesture() : false; if (for_io_thread) { renderview->Send(new ExtensionHostMsg_RequestForIOThread( - renderview->routing_id(), params)); + renderview->GetRoutingId(), params)); } else { renderview->Send(new ExtensionHostMsg_Request( - renderview->routing_id(), params)); + renderview->GetRoutingId(), params)); } return v8::Undefined(); @@ -575,10 +576,10 @@ class ExtensionImpl : public ChromeV8Extension { } static v8::Handle<v8::Value> GetRenderViewId(const v8::Arguments& args) { - RenderView* renderview = GetCurrentRenderView(); + content::RenderView* renderview = GetCurrentRenderView(); if (!renderview) return v8::Undefined(); - return v8::Integer::New(renderview->routing_id()); + return v8::Integer::New(renderview->GetRoutingId()); } }; diff --git a/chrome/renderer/extensions/renderer_extension_bindings.cc b/chrome/renderer/extensions/renderer_extension_bindings.cc index 2c250a2..66368ad3 100644 --- a/chrome/renderer/extensions/renderer_extension_bindings.cc +++ b/chrome/renderer/extensions/renderer_extension_bindings.cc @@ -18,7 +18,7 @@ #include "chrome/renderer/extensions/event_bindings.h" #include "chrome/renderer/extensions/extension_dispatcher.h" #include "content/public/renderer/render_thread.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "grit/renderer_resources.h" #include "v8/include/v8.h" @@ -97,7 +97,7 @@ class ExtensionImpl : public ChromeV8Extension { const v8::Arguments& args) { // Get the current RenderView so that we can send a routed IPC message from // the correct source. - RenderView* renderview = GetCurrentRenderView(); + content::RenderView* renderview = GetCurrentRenderView(); if (!renderview) return v8::Undefined(); @@ -108,7 +108,7 @@ class ExtensionImpl : public ChromeV8Extension { std::string channel_name = *v8::String::Utf8Value(args[2]->ToString()); int port_id = -1; renderview->Send(new ExtensionHostMsg_OpenChannelToExtension( - renderview->routing_id(), source_id, target_id, + renderview->GetRoutingId(), source_id, target_id, channel_name, &port_id)); return v8::Integer::New(port_id); } @@ -117,7 +117,7 @@ class ExtensionImpl : public ChromeV8Extension { // Sends a message along the given channel. static v8::Handle<v8::Value> PostMessage(const v8::Arguments& args) { - RenderView* renderview = GetCurrentRenderView(); + content::RenderView* renderview = GetCurrentRenderView(); if (!renderview) return v8::Undefined(); @@ -129,7 +129,7 @@ class ExtensionImpl : public ChromeV8Extension { } std::string message = *v8::String::Utf8Value(args[1]->ToString()); renderview->Send(new ExtensionHostMsg_PostMessage( - renderview->routing_id(), port_id, message)); + renderview->GetRoutingId(), port_id, message)); } return v8::Undefined(); } @@ -196,7 +196,7 @@ class ExtensionImpl : public ChromeV8Extension { if (!l10n_messages) { // Get the current RenderView so that we can send a routed IPC message // from the correct source. - RenderView* renderview = GetCurrentRenderView(); + content::RenderView* renderview = GetCurrentRenderView(); if (!renderview) return v8::Undefined(); @@ -259,7 +259,7 @@ void RendererExtensionBindings::DeliverMessage( const ChromeV8ContextSet::ContextSet& contexts, int target_port_id, const std::string& message, - RenderView* restrict_to_render_view) { + content::RenderView* restrict_to_render_view) { v8::HandleScope handle_scope; for (ChromeV8ContextSet::ContextSet::const_iterator it = contexts.begin(); diff --git a/chrome/renderer/extensions/renderer_extension_bindings.h b/chrome/renderer/extensions/renderer_extension_bindings.h index 0be2cb3..88cc19a 100644 --- a/chrome/renderer/extensions/renderer_extension_bindings.h +++ b/chrome/renderer/extensions/renderer_extension_bindings.h @@ -11,7 +11,10 @@ #include "chrome/renderer/extensions/chrome_v8_context_set.h" class ExtensionDispatcher; + +namespace content { class RenderView; +} namespace v8 { class Extension; @@ -31,7 +34,7 @@ class RendererExtensionBindings { const ChromeV8ContextSet::ContextSet& context_set, int target_port_id, const std::string& message, - RenderView* restrict_to_render_view); + content::RenderView* restrict_to_render_view); }; #endif // CHROME_RENDERER_EXTENSIONS_RENDERER_EXTENSION_BINDINGS_H_ diff --git a/chrome/renderer/extensions/user_script_idle_scheduler.cc b/chrome/renderer/extensions/user_script_idle_scheduler.cc index 5c9eea6..6dec8c4 100644 --- a/chrome/renderer/extensions/user_script_idle_scheduler.cc +++ b/chrome/renderer/extensions/user_script_idle_scheduler.cc @@ -11,7 +11,7 @@ #include "chrome/renderer/extensions/extension_groups.h" #include "chrome/renderer/extensions/extension_helper.h" #include "chrome/renderer/extensions/user_script_slave.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" @@ -97,13 +97,14 @@ void UserScriptIdleScheduler::ExecuteCodeImpl( const ExtensionMsg_ExecuteCode_Params& params) { const Extension* extension = extension_dispatcher_->extensions()->GetByID( params.extension_id); - RenderView* render_view = RenderView::FromWebView(frame_->view()); + content::RenderView* render_view = + content::RenderView::FromWebView(frame_->view()); // Since extension info is sent separately from user script info, they can // be out of sync. We just ignore this situation. if (!extension) { render_view->Send(new ExtensionHostMsg_ExecuteCodeFinished( - render_view->routing_id(), params.request_id, true, "")); + render_view->GetRoutingId(), params.request_id, true, "")); return; } @@ -132,7 +133,7 @@ void UserScriptIdleScheduler::ExecuteCodeImpl( continue; } else { render_view->Send(new ExtensionHostMsg_ExecuteCodeFinished( - render_view->routing_id(), params.request_id, false, + render_view->GetRoutingId(), params.request_id, false, ExtensionErrorUtils::FormatErrorMessage( extension_manifest_errors::kCannotAccessPage, frame->document().url().spec()))); @@ -160,7 +161,7 @@ void UserScriptIdleScheduler::ExecuteCodeImpl( } render_view->Send(new ExtensionHostMsg_ExecuteCodeFinished( - render_view->routing_id(), params.request_id, true, "")); + render_view->GetRoutingId(), params.request_id, true, "")); } bool UserScriptIdleScheduler::GetAllChildFrames( diff --git a/chrome/renderer/external_extension.cc b/chrome/renderer/external_extension.cc index 010e910..c719aed 100644 --- a/chrome/renderer/external_extension.cc +++ b/chrome/renderer/external_extension.cc @@ -8,7 +8,7 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/render_messages.h" #include "chrome/common/search_provider.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" @@ -16,6 +16,7 @@ using WebKit::WebFrame; using WebKit::WebView; +using content::RenderView; namespace extensions_v8 { @@ -128,11 +129,11 @@ v8::Handle<v8::Value> ExternalExtensionWrapper::AddSearchProvider( if (!render_view) return v8::Undefined(); if (provider_type != search_provider::EXPLICIT_DEFAULT_PROVIDER || - render_view->webview()->mainFrame()->isProcessingUserGesture()) { + render_view->GetWebView()->mainFrame()->isProcessingUserGesture()) { GURL osd_url(name); if (!osd_url.is_empty()) { render_view->Send(new ChromeViewHostMsg_PageHasOSDD( - render_view->routing_id(), render_view->page_id(), osd_url, + render_view->GetRoutingId(), render_view->GetPageId(), osd_url, provider_type)); } } @@ -158,7 +159,7 @@ v8::Handle<v8::Value> ExternalExtensionWrapper::IsSearchProviderInstalled( GURL inquiry_url = GURL(name); if (!inquiry_url.is_empty()) { render_view->Send(new ChromeViewHostMsg_GetSearchProviderInstallState( - render_view->routing_id(), + render_view->GetRoutingId(), webframe->document().url(), inquiry_url, &install)); diff --git a/chrome/renderer/frame_sniffer.cc b/chrome/renderer/frame_sniffer.cc index 77c29e3..d9e7213 100644 --- a/chrome/renderer/frame_sniffer.cc +++ b/chrome/renderer/frame_sniffer.cc @@ -10,7 +10,8 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h" -FrameSniffer::FrameSniffer(RenderView* render_view, const string16 &frame_name) +FrameSniffer::FrameSniffer(content::RenderView* render_view, + const string16 &frame_name) : content::RenderViewObserver(render_view), frame_name_(frame_name) { } diff --git a/chrome/renderer/frame_sniffer.h b/chrome/renderer/frame_sniffer.h index 55af6d02..9f9ea1f 100644 --- a/chrome/renderer/frame_sniffer.h +++ b/chrome/renderer/frame_sniffer.h @@ -13,7 +13,7 @@ // messages to be handled by RenderViewHostObserver. class FrameSniffer : public content::RenderViewObserver { public: - FrameSniffer(RenderView* render_view, const string16 &frame_name); + FrameSniffer(content::RenderView* render_view, const string16 &frame_name); virtual ~FrameSniffer(); // Implements RenderViewObserver. diff --git a/chrome/renderer/page_click_tracker.cc b/chrome/renderer/page_click_tracker.cc index c06cc4b..b719eac 100644 --- a/chrome/renderer/page_click_tracker.cc +++ b/chrome/renderer/page_click_tracker.cc @@ -7,7 +7,7 @@ #include "chrome/common/render_messages.h" #include "chrome/renderer/page_click_listener.h" #include "content/common/view_messages.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMMouseEvent.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" @@ -47,7 +47,7 @@ const WebInputElement GetTextWebInputElement(const WebNode& node) { } // namespace -PageClickTracker::PageClickTracker(RenderView* render_view) +PageClickTracker::PageClickTracker(content::RenderView* render_view) : content::RenderViewObserver(render_view), was_focused_(false) { } @@ -73,7 +73,7 @@ void PageClickTracker::DidHandleMouseEvent(const WebMouseEvent& event) { if (input_element.isNull()) return; - bool is_focused = (last_node_clicked_ == GetFocusedNode()); + bool is_focused = (last_node_clicked_ == render_view()->GetFocusedNode()); ObserverListBase<PageClickListener>::Iterator it(listeners_); PageClickListener* listener; while ((listener = it.GetNext()) != NULL) { @@ -144,17 +144,5 @@ void PageClickTracker::handleEvent(const WebDOMEvent& event) { return; last_node_clicked_ = node; - was_focused_ = (GetFocusedNode() == last_node_clicked_); -} - -WebNode PageClickTracker::GetFocusedNode() { - WebView* web_view = render_view()->webview(); - if (!web_view) - return WebNode(); - - WebFrame* web_frame = web_view->focusedFrame(); - if (!web_frame) - return WebNode(); - - return web_frame->document().focusedNode(); + was_focused_ = (render_view()->GetFocusedNode() == last_node_clicked_); } diff --git a/chrome/renderer/page_click_tracker.h b/chrome/renderer/page_click_tracker.h index 29b3b8f..2f2b2e4 100644 --- a/chrome/renderer/page_click_tracker.h +++ b/chrome/renderer/page_click_tracker.h @@ -31,7 +31,7 @@ class PageClickListener; class PageClickTracker : public content::RenderViewObserver, public WebKit::WebDOMEventListener { public: - explicit PageClickTracker(RenderView* render_view); + explicit PageClickTracker(content::RenderView* render_view); virtual ~PageClickTracker(); // Adds/removes a listener for getting notification when an element is @@ -53,10 +53,6 @@ class PageClickTracker : public content::RenderViewObserver, // Called after the mouse event |event| has been processed by WebKit. virtual void DidHandleMouseEvent(const WebKit::WebMouseEvent& event); - // Returns the currently focused node in the associated render view. - // That node may be null. - WebKit::WebNode GetFocusedNode(); - // The last node that was clicked and had focus. WebKit::WebNode last_node_clicked_; diff --git a/chrome/renderer/page_load_histograms.cc b/chrome/renderer/page_load_histograms.cc index 0c7f82b..428d3cf 100644 --- a/chrome/renderer/page_load_histograms.cc +++ b/chrome/renderer/page_load_histograms.cc @@ -14,7 +14,7 @@ #include "chrome/renderer/renderer_histogram_snapshots.h" #include "content/common/view_messages.h" #include "content/public/renderer/navigation_state.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "googleurl/src/gurl.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" @@ -84,7 +84,7 @@ enum AbandonType { }; PageLoadHistograms::PageLoadHistograms( - RenderView* render_view, + content::RenderView* render_view, RendererHistogramSnapshots* histogram_snapshots) : content::RenderViewObserver(render_view), cross_origin_access_count_(0), @@ -782,7 +782,7 @@ bool PageLoadHistograms::OnMessageReceived(const IPC::Message& message) { // TODO(davemoore) This code should be removed once willClose() gets // called when a page is destroyed. page_load_histograms_.Dump() is safe // to call multiple times for the same frame, but it will simplify things. - Dump(render_view()->webview()->mainFrame()); + Dump(render_view()->GetWebView()->mainFrame()); ResetCrossFramePropertyAccess(); } return false; diff --git a/chrome/renderer/page_load_histograms.h b/chrome/renderer/page_load_histograms.h index 88774fc..eaaeaa5 100644 --- a/chrome/renderer/page_load_histograms.h +++ b/chrome/renderer/page_load_histograms.h @@ -16,7 +16,7 @@ class NavigationState; class PageLoadHistograms : public content::RenderViewObserver { public: - PageLoadHistograms(RenderView* render_view, + PageLoadHistograms(content::RenderView* render_view, RendererHistogramSnapshots* histogram_snapshots); private: diff --git a/chrome/renderer/prerender/prerender_helper.cc b/chrome/renderer/prerender/prerender_helper.cc index e64fede..58eb2f4 100644 --- a/chrome/renderer/prerender/prerender_helper.cc +++ b/chrome/renderer/prerender/prerender_helper.cc @@ -8,7 +8,7 @@ #include "base/metrics/histogram.h" #include "chrome/common/render_messages.h" #include "content/public/renderer/navigation_state.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" @@ -27,7 +27,7 @@ using content::NavigationState; namespace prerender { -PrerenderHelper::PrerenderHelper(RenderView* render_view) +PrerenderHelper::PrerenderHelper(content::RenderView* render_view) : content::RenderViewObserver(render_view), content::RenderViewObserverTracker<PrerenderHelper>(render_view), is_prerendering_(true), @@ -39,14 +39,14 @@ PrerenderHelper::~PrerenderHelper() { } // static. -bool PrerenderHelper::IsPrerendering(const RenderView* render_view) { +bool PrerenderHelper::IsPrerendering(const content::RenderView* render_view) { PrerenderHelper* prerender_helper = PrerenderHelper::Get(render_view); return (prerender_helper && prerender_helper->is_prerendering_); } // static. void PrerenderHelper::RecordHistograms( - RenderView* render_view, + content::RenderView* render_view, const base::Time& finish_all_loads, const base::TimeDelta& begin_to_finish_all_loads) { static bool use_prerender_histogram = @@ -117,7 +117,7 @@ void PrerenderHelper::WillCreateMediaPlayer( // Cancel prerendering in the case of HTML5 media, to avoid playing sounds // in the background. Send(new ChromeViewHostMsg_MaybeCancelPrerenderForHTML5Media( - render_view()->routing_id())); + render_view()->GetRoutingId())); } } @@ -167,10 +167,9 @@ bool PrerenderHelper::HasUnrecordedData() const { } void PrerenderHelper::UpdateVisibilityState() { - if (render_view()->webview()) { - render_view()->webview()->setVisibilityState( - render_view()->visibilityState(), - false); + if (render_view()->GetWebView()) { + render_view()->GetWebView()->setVisibilityState( + render_view()->GetVisibilityState(), false); } } diff --git a/chrome/renderer/prerender/prerender_helper.h b/chrome/renderer/prerender/prerender_helper.h index 068aa36..c716d5d 100644 --- a/chrome/renderer/prerender/prerender_helper.h +++ b/chrome/renderer/prerender/prerender_helper.h @@ -23,16 +23,16 @@ class PrerenderHelper : public content::RenderViewObserver, public content::RenderViewObserverTracker<PrerenderHelper> { public: - explicit PrerenderHelper(RenderView* render_view); + explicit PrerenderHelper(content::RenderView* render_view); virtual ~PrerenderHelper(); // Returns true if |render_view| is currently prerendering. - static bool IsPrerendering(const RenderView* render_view); + static bool IsPrerendering(const content::RenderView* render_view); // Records prerender histograms. These are recorded even for pages that are // not prerendered, for comparison to pages that are. static void RecordHistograms( - RenderView* render_view, + content::RenderView* render_view, const base::Time& finish_all_loads, const base::TimeDelta& begin_to_finish_all_loads); diff --git a/chrome/renderer/print_web_view_helper.cc b/chrome/renderer/print_web_view_helper.cc index a8c2ca5..e651d36 100644 --- a/chrome/renderer/print_web_view_helper.cc +++ b/chrome/renderer/print_web_view_helper.cc @@ -17,7 +17,7 @@ #include "chrome/common/url_constants.h" #include "chrome/renderer/prerender/prerender_helper.h" #include "content/public/renderer/render_thread.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "grit/generated_resources.h" #include "printing/metafile_impl.h" #include "printing/page_size_margins.h" @@ -35,6 +35,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" #include "ui/base/l10n/l10n_util.h" +#include "webkit/glue/webpreferences.h" #if defined(OS_POSIX) #include "base/process_util.h" @@ -506,7 +507,7 @@ void PrepareFrameAndViewForPrint::FinishPrinting() { } } -PrintWebViewHelper::PrintWebViewHelper(RenderView* render_view) +PrintWebViewHelper::PrintWebViewHelper(content::RenderView* render_view) : content::RenderViewObserver(render_view), content::RenderViewObserverTracker<PrintWebViewHelper>(render_view), print_web_view_(NULL), @@ -567,9 +568,9 @@ void PrintWebViewHelper::OnPrintForPrintPreview( if (print_web_view_) return; - if (!render_view()->webview()) + if (!render_view()->GetWebView()) return; - WebFrame* main_frame = render_view()->webview()->mainFrame(); + WebFrame* main_frame = render_view()->GetWebView()->mainFrame(); if (!main_frame) return; @@ -604,15 +605,15 @@ void PrintWebViewHelper::OnPrintForPrintPreview( bool PrintWebViewHelper::GetPrintFrame(WebKit::WebFrame** frame) { DCHECK(frame); - DCHECK(render_view()->webview()); - if (!render_view()->webview()) + DCHECK(render_view()->GetWebView()); + if (!render_view()->GetWebView()) return false; // If the user has selected text in the currently focused frame we print // only that frame (this makes print selection work for multiple frames). - *frame = render_view()->webview()->focusedFrame()->hasSelection() ? - render_view()->webview()->focusedFrame() : - render_view()->webview()->mainFrame(); + *frame = render_view()->GetWebView()->focusedFrame()->hasSelection() ? + render_view()->GetWebView()->focusedFrame() : + render_view()->GetWebView()->mainFrame(); return true; } @@ -773,7 +774,7 @@ void PrintWebViewHelper::OnPrintingDone(bool success) { } void PrintWebViewHelper::OnPrintNodeUnderContextMenu() { - const WebNode& context_menu_node = render_view()->context_menu_node(); + const WebNode& context_menu_node = render_view()->GetContextMenuNode(); if (context_menu_node.isNull()) { NOTREACHED(); return; @@ -884,7 +885,7 @@ bool PrintWebViewHelper::CopyAndPrint(WebKit::WebFrame* web_frame) { // Create a new WebView with the same settings as the current display one. // Except that we disable javascript (don't want any active content running // on the page). - WebPreferences prefs = render_view()->webkit_preferences(); + WebPreferences prefs = render_view()->GetWebkitPreferences(); prefs.javascript_enabled = false; prefs.java_enabled = false; @@ -1073,7 +1074,7 @@ bool PrintWebViewHelper::InitPrintSettings(WebKit::WebFrame* frame, // terminate. bool result = true; if (PrintMsg_Print_Params_IsEmpty(settings.params)) { - render_view()->runModalAlertDialog( + render_view()->RunModalAlertDialog( frame, l10n_util::GetStringUTF16( IDS_PRINT_PREVIEW_INVALID_PRINTER_SETTINGS)); @@ -1134,7 +1135,7 @@ bool PrintWebViewHelper::UpdatePrintSettings( GetPrintFrame(&frame); } if (frame) { - render_view()->runModalAlertDialog( + render_view()->RunModalAlertDialog( frame, l10n_util::GetStringUTF16( IDS_PRINT_PREVIEW_INVALID_PRINTER_SETTINGS)); @@ -1210,11 +1211,11 @@ bool PrintWebViewHelper::GetPrintSettingsFromUser(WebKit::WebFrame* frame, // The routing id is sent across as it is needed to look up the // corresponding RenderViewHost instance to signal and reset the // pump messages event. - params.routing_id = render_view()->routing_id(); + params.routing_id = render_view()->GetRoutingId(); // host_window_ may be NULL at this point if the current window is a // popup and the print() command has been issued from the parent. The // receiver of this message has to deal with this. - params.host_window_id = render_view()->host_window(); + params.host_window_id = render_view()->GetHostWindow(); params.cookie = print_pages_params_->params.document_cookie; params.has_selection = frame->hasSelection(); params.expected_pages_count = expected_pages_count; @@ -1314,9 +1315,9 @@ void PrintWebViewHelper::IncrementScriptedPrintCount() { void PrintWebViewHelper::DisplayPrintJobError() { WebView* web_view = print_web_view_; if (!web_view) - web_view = render_view()->webview(); + web_view = render_view()->GetWebView(); - render_view()->runModalAlertDialog( + render_view()->RunModalAlertDialog( web_view->mainFrame(), l10n_util::GetStringUTF16(IDS_PRINT_SPOOL_FAILED_ERROR_TEXT)); } diff --git a/chrome/renderer/print_web_view_helper.h b/chrome/renderer/print_web_view_helper.h index b4a959a..3cd117e 100644 --- a/chrome/renderer/print_web_view_helper.h +++ b/chrome/renderer/print_web_view_helper.h @@ -92,7 +92,7 @@ class PrintWebViewHelper public WebKit::WebViewClient, public WebKit::WebFrameClient { public: - explicit PrintWebViewHelper(RenderView* render_view); + explicit PrintWebViewHelper(content::RenderView* render_view); virtual ~PrintWebViewHelper(); protected: diff --git a/chrome/renderer/print_web_view_helper_linux.cc b/chrome/renderer/print_web_view_helper_linux.cc index 964dcdf..6e1ff5c 100644 --- a/chrome/renderer/print_web_view_helper_linux.cc +++ b/chrome/renderer/print_web_view_helper_linux.cc @@ -10,7 +10,6 @@ #include "base/metrics/histogram.h" #include "chrome/common/print_messages.h" #include "content/public/renderer/render_thread.h" -#include "content/renderer/render_view.h" #include "printing/metafile.h" #include "printing/metafile_impl.h" #include "printing/metafile_skia_wrapper.h" diff --git a/chrome/renderer/safe_browsing/malware_dom_details.cc b/chrome/renderer/safe_browsing/malware_dom_details.cc index e488a76..022b0e6 100644 --- a/chrome/renderer/safe_browsing/malware_dom_details.cc +++ b/chrome/renderer/safe_browsing/malware_dom_details.cc @@ -7,7 +7,7 @@ #include "base/compiler_specific.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/safe_browsing/safebrowsing_messages.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" @@ -21,15 +21,14 @@ namespace safe_browsing { uint32 MalwareDOMDetails::kMaxNodes = 500; // static -MalwareDOMDetails* MalwareDOMDetails::Create(RenderView* render_view) { +MalwareDOMDetails* MalwareDOMDetails::Create(content::RenderView* render_view) { // Private constructor and public static Create() method to facilitate // stubbing out this class for binary-size reduction purposes. return new MalwareDOMDetails(render_view); } -MalwareDOMDetails::MalwareDOMDetails(RenderView* render_view) - : content::RenderViewObserver(render_view), - render_view_(render_view) { +MalwareDOMDetails::MalwareDOMDetails(content::RenderView* render_view) + : content::RenderViewObserver(render_view) { } MalwareDOMDetails::~MalwareDOMDetails() { @@ -49,12 +48,12 @@ void MalwareDOMDetails::OnGetMalwareDOMDetails() { ExtractResources(&resources); // Notify the browser. render_view()->Send(new SafeBrowsingHostMsg_MalwareDOMDetails( - render_view()->routing_id(), resources)); + render_view()->GetRoutingId(), resources)); } void MalwareDOMDetails::ExtractResources( std::vector<SafeBrowsingHostMsg_MalwareDOMDetails_Node>* resources) { - WebKit::WebView* web_view = render_view_->webview(); + WebKit::WebView* web_view = render_view()->GetWebView(); if (!web_view) { NOTREACHED(); return; diff --git a/chrome/renderer/safe_browsing/malware_dom_details.h b/chrome/renderer/safe_browsing/malware_dom_details.h index c91cbb1..6a831ae 100644 --- a/chrome/renderer/safe_browsing/malware_dom_details.h +++ b/chrome/renderer/safe_browsing/malware_dom_details.h @@ -19,7 +19,6 @@ #include "content/public/renderer/render_view_observer.h" class GURL; -class RenderView; namespace WebKit { class WebElement; @@ -36,7 +35,7 @@ class MalwareDOMDetails : public content::RenderViewObserver { // An upper limit on the number of nodes we collect. Not const for the test. static uint32 kMaxNodes; - static MalwareDOMDetails* Create(RenderView* render_view); + static MalwareDOMDetails* Create(content::RenderView* render_view); virtual ~MalwareDOMDetails(); // Begins extracting resource urls for the page currently loaded in @@ -48,7 +47,7 @@ class MalwareDOMDetails : public content::RenderViewObserver { // Creates a MalwareDOMDetails for the specified RenderView. // The MalwareDOMDetails should be destroyed prior to destroying // the RenderView. - explicit MalwareDOMDetails(RenderView* render_view); + explicit MalwareDOMDetails(content::RenderView* render_view); // RenderViewObserver implementation. virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; @@ -61,9 +60,6 @@ class MalwareDOMDetails : public content::RenderViewObserver { SafeBrowsingHostMsg_MalwareDOMDetails_Node* parent_node, std::vector<SafeBrowsingHostMsg_MalwareDOMDetails_Node>* resources); - // Non-owned pointer to the view that we will extract features from. - RenderView* render_view_; - DISALLOW_COPY_AND_ASSIGN(MalwareDOMDetails); }; diff --git a/chrome/renderer/safe_browsing/phishing_classifier.cc b/chrome/renderer/safe_browsing/phishing_classifier.cc index 1da1a50..1fa068e 100644 --- a/chrome/renderer/safe_browsing/phishing_classifier.cc +++ b/chrome/renderer/safe_browsing/phishing_classifier.cc @@ -20,7 +20,7 @@ #include "chrome/renderer/safe_browsing/phishing_term_feature_extractor.h" #include "chrome/renderer/safe_browsing/phishing_url_feature_extractor.h" #include "chrome/renderer/safe_browsing/scorer.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "crypto/sha2.h" #include "googleurl/src/gurl.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" @@ -35,7 +35,7 @@ namespace safe_browsing { const float PhishingClassifier::kInvalidScore = -1.0; const float PhishingClassifier::kPhishyThreshold = 0.5; -PhishingClassifier::PhishingClassifier(RenderView* render_view, +PhishingClassifier::PhishingClassifier(content::RenderView* render_view, FeatureExtractorClock* clock) : render_view_(render_view), scorer_(NULL), @@ -93,7 +93,7 @@ void PhishingClassifier::BeginClassification(const string16* page_text, } void PhishingClassifier::BeginFeatureExtraction() { - WebKit::WebView* web_view = render_view_->webview(); + WebKit::WebView* web_view = render_view_->GetWebView(); if (!web_view) { RunFailureCallback(); return; @@ -157,7 +157,7 @@ void PhishingClassifier::DOMExtractionFinished(bool success) { void PhishingClassifier::TermExtractionFinished(bool success) { if (success) { - WebKit::WebView* web_view = render_view_->webview(); + WebKit::WebView* web_view = render_view_->GetWebView(); if (!web_view) { RunFailureCallback(); return; diff --git a/chrome/renderer/safe_browsing/phishing_classifier.h b/chrome/renderer/safe_browsing/phishing_classifier.h index fef9476..b3b8fce 100644 --- a/chrome/renderer/safe_browsing/phishing_classifier.h +++ b/chrome/renderer/safe_browsing/phishing_classifier.h @@ -24,7 +24,9 @@ #include "base/string16.h" #include "base/task.h" +namespace content { class RenderView; +} namespace safe_browsing { class ClientPhishingRequest; @@ -52,7 +54,8 @@ class PhishingClassifier { // |render_view|. |clock| is used to time feature extractor operations, and // the PhishingClassifier takes ownership of this object. Note that the // classifier will not be 'ready' until set_phishing_scorer() is called. - PhishingClassifier(RenderView* render_view, FeatureExtractorClock* clock); + PhishingClassifier(content::RenderView* render_view, + FeatureExtractorClock* clock); virtual ~PhishingClassifier(); // Sets a scorer for the classifier to use in computing the phishiness score. @@ -123,7 +126,7 @@ class PhishingClassifier { // Clears the current state of the PhishingClassifier. void Clear(); - RenderView* render_view_; // owns us + content::RenderView* render_view_; // owns us const Scorer* scorer_; // owned by the caller scoped_ptr<FeatureExtractorClock> clock_; scoped_ptr<PhishingUrlFeatureExtractor> url_extractor_; diff --git a/chrome/renderer/safe_browsing/phishing_classifier_browsertest.cc b/chrome/renderer/safe_browsing/phishing_classifier_browsertest.cc index bf68d58..7e34cd6 100644 --- a/chrome/renderer/safe_browsing/phishing_classifier_browsertest.cc +++ b/chrome/renderer/safe_browsing/phishing_classifier_browsertest.cc @@ -80,7 +80,7 @@ class PhishingClassifierTest : public RenderViewFakeResourcesTest { clock_ = new MockFeatureExtractorClock; scorer_.reset(Scorer::Create(model.SerializeAsString())); ASSERT_TRUE(scorer_.get()); - classifier_.reset(new PhishingClassifier(view_, clock_)); + classifier_.reset(new PhishingClassifier(view(), clock_)); } virtual void TearDown() { diff --git a/chrome/renderer/safe_browsing/phishing_classifier_delegate.cc b/chrome/renderer/safe_browsing/phishing_classifier_delegate.cc index 5d0068f..775c771 100644 --- a/chrome/renderer/safe_browsing/phishing_classifier_delegate.cc +++ b/chrome/renderer/safe_browsing/phishing_classifier_delegate.cc @@ -18,7 +18,7 @@ #include "chrome/renderer/safe_browsing/scorer.h" #include "content/public/renderer/navigation_state.h" #include "content/public/renderer/render_thread.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" @@ -79,14 +79,14 @@ void PhishingClassifierFilter::OnSetPhishingModel(const std::string& model) { // static PhishingClassifierDelegate* PhishingClassifierDelegate::Create( - RenderView* render_view, PhishingClassifier* classifier) { + content::RenderView* render_view, PhishingClassifier* classifier) { // Private constructor and public static Create() method to facilitate // stubbing out this class for binary-size reduction purposes. return new PhishingClassifierDelegate(render_view, classifier); } PhishingClassifierDelegate::PhishingClassifierDelegate( - RenderView* render_view, + content::RenderView* render_view, PhishingClassifier* classifier) : content::RenderViewObserver(render_view), last_main_frame_transition_(PageTransition::LINK), @@ -111,7 +111,7 @@ PhishingClassifierDelegate::~PhishingClassifierDelegate() { void PhishingClassifierDelegate::SetPhishingScorer( const safe_browsing::Scorer* scorer) { - if (!render_view()->webview()) + if (!render_view()->GetWebView()) return; // RenderView is tearing down. if (is_classifying_) { // If there is a classification going on right now it means we're @@ -148,7 +148,7 @@ void PhishingClassifierDelegate::DidCommitProvisionalLoad( frame->dataSource()); CancelPendingClassification(state->was_within_same_page() ? NAVIGATE_WITHIN_PAGE : NAVIGATE_AWAY); - if (frame == render_view()->webview()->mainFrame()) { + if (frame == render_view()->GetWebView()->mainFrame()) { last_main_frame_transition_ = state->transition_type(); } } @@ -210,7 +210,7 @@ void PhishingClassifierDelegate::ClassificationDone( } GURL PhishingClassifierDelegate::GetToplevelUrl() { - return render_view()->webview()->mainFrame()->document().url(); + return render_view()->GetWebView()->mainFrame()->document().url(); } void PhishingClassifierDelegate::MaybeStartClassification() { diff --git a/chrome/renderer/safe_browsing/phishing_classifier_delegate.h b/chrome/renderer/safe_browsing/phishing_classifier_delegate.h index 57254d2..75ffdf6 100644 --- a/chrome/renderer/safe_browsing/phishing_classifier_delegate.h +++ b/chrome/renderer/safe_browsing/phishing_classifier_delegate.h @@ -39,7 +39,7 @@ class PhishingClassifierDelegate : public content::RenderViewObserver { // The RenderView owns us. This object takes ownership of the classifier. // Note that if classifier is null, a default instance of PhishingClassifier // will be used. - static PhishingClassifierDelegate* Create(RenderView* render_view, + static PhishingClassifierDelegate* Create(content::RenderView* render_view, PhishingClassifier* classifier); virtual ~PhishingClassifierDelegate(); @@ -66,7 +66,7 @@ class PhishingClassifierDelegate : public content::RenderViewObserver { private: friend class PhishingClassifierDelegateTest; - PhishingClassifierDelegate(RenderView* render_view, + PhishingClassifierDelegate(content::RenderView* render_view, PhishingClassifier* classifier); enum CancelClassificationReason { diff --git a/chrome/renderer/safe_browsing/phishing_dom_feature_extractor.cc b/chrome/renderer/safe_browsing/phishing_dom_feature_extractor.cc index f20d782..65e3ec0 100644 --- a/chrome/renderer/safe_browsing/phishing_dom_feature_extractor.cc +++ b/chrome/renderer/safe_browsing/phishing_dom_feature_extractor.cc @@ -13,7 +13,7 @@ #include "base/time.h" #include "chrome/renderer/safe_browsing/feature_extractor_clock.h" #include "chrome/renderer/safe_browsing/features.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "net/base/registry_controlled_domain.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" @@ -98,7 +98,7 @@ struct PhishingDOMFeatureExtractor::FrameData { }; PhishingDOMFeatureExtractor::PhishingDOMFeatureExtractor( - RenderView* render_view, + content::RenderView* render_view, FeatureExtractorClock* clock) : render_view_(render_view), clock_(clock), @@ -126,7 +126,7 @@ void PhishingDOMFeatureExtractor::ExtractFeatures( done_callback_.reset(done_callback); page_feature_state_.reset(new PageFeatureState(clock_->Now())); - WebKit::WebView* web_view = render_view_->webview(); + WebKit::WebView* web_view = render_view_->GetWebView(); if (web_view && web_view->mainFrame()) { cur_document_ = web_view->mainFrame()->document(); } diff --git a/chrome/renderer/safe_browsing/phishing_dom_feature_extractor.h b/chrome/renderer/safe_browsing/phishing_dom_feature_extractor.h index 5f8a7c5..d7d3e78 100644 --- a/chrome/renderer/safe_browsing/phishing_dom_feature_extractor.h +++ b/chrome/renderer/safe_browsing/phishing_dom_feature_extractor.h @@ -19,12 +19,15 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" class GURL; -class RenderView; namespace WebKit { class WebElement; } +namespace content { +class RenderView; +} + namespace safe_browsing { class FeatureExtractorClock; class FeatureMap; @@ -40,7 +43,7 @@ class PhishingDOMFeatureExtractor { // the RenderView. |clock| is used for timing feature extractor operations, // and may be mocked for testing. The caller maintains ownership of the // clock. - PhishingDOMFeatureExtractor(RenderView* render_view, + PhishingDOMFeatureExtractor(content::RenderView* render_view, FeatureExtractorClock* clock); ~PhishingDOMFeatureExtractor(); @@ -121,7 +124,7 @@ class PhishingDOMFeatureExtractor { void InsertFeatures(); // Non-owned pointer to the view that we will extract features from. - RenderView* render_view_; + content::RenderView* render_view_; // Non-owned pointer to our clock. FeatureExtractorClock* clock_; diff --git a/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc b/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc index b5f3f63..d66d54ba 100644 --- a/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc +++ b/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc @@ -51,7 +51,7 @@ class PhishingDOMFeatureExtractorTest : public RenderViewFakeResourcesTest { virtual void SetUp() { // Set up WebKit and the RenderView. RenderViewFakeResourcesTest::SetUp(); - extractor_.reset(new PhishingDOMFeatureExtractor(view_, &clock_)); + extractor_.reset(new PhishingDOMFeatureExtractor(view(), &clock_)); } virtual void TearDown() { diff --git a/chrome/renderer/safe_browsing/phishing_thumbnailer.cc b/chrome/renderer/safe_browsing/phishing_thumbnailer.cc index e8a3b4f..0c33f0b 100644 --- a/chrome/renderer/safe_browsing/phishing_thumbnailer.cc +++ b/chrome/renderer/safe_browsing/phishing_thumbnailer.cc @@ -7,7 +7,7 @@ #include "base/logging.h" #include "base/metrics/histogram.h" #include "base/time.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "skia/ext/image_operations.h" #include "skia/ext/platform_canvas.h" #include "third_party/skia/include/core/SkBitmap.h" @@ -24,13 +24,13 @@ using WebKit::WebView; namespace safe_browsing { -SkBitmap GrabPhishingThumbnail(RenderView* render_view, +SkBitmap GrabPhishingThumbnail(content::RenderView* render_view, const gfx::Size& view_size, const gfx::Size& thumbnail_size) { - if (!render_view || !render_view->webview()) { + if (!render_view || !render_view->GetWebView()) { return SkBitmap(); // The WebView is going away. } - WebView* view = render_view->webview(); + WebView* view = render_view->GetWebView(); base::TimeTicks beginning_time = base::TimeTicks::Now(); skia::PlatformCanvas canvas; if (!canvas.initialize(view_size.width(), view_size.height(), true)) { @@ -69,7 +69,7 @@ SkBitmap GrabPhishingThumbnail(RenderView* render_view, } // Maybe re-display the scrollbars and resize the view to its old size. view->mainFrame()->setCanHaveScrollbars( - render_view->should_display_scrollbars(old_size.width, old_size.height)); + render_view->ShouldDisplayScrollbars(old_size.width, old_size.height)); view->resize(old_size); UMA_HISTOGRAM_TIMES("SBClientPhishing.GrabPhishingThumbnail", diff --git a/chrome/renderer/safe_browsing/phishing_thumbnailer.h b/chrome/renderer/safe_browsing/phishing_thumbnailer.h index 99460c6..d172932 100644 --- a/chrome/renderer/safe_browsing/phishing_thumbnailer.h +++ b/chrome/renderer/safe_browsing/phishing_thumbnailer.h @@ -18,10 +18,13 @@ #define CHROME_RENDERER_SAFE_BROWSING_PHISHING_THUMBNAILER_H_ #pragma once +namespace content { +class RenderView; +} + namespace gfx { class Size; } -class RenderView; class SkBitmap; namespace safe_browsing { @@ -31,7 +34,7 @@ namespace safe_browsing { // snapshot will then be re-sized to the given |thumbnail_size|. If grabbing // the thumbnail fails this function returns SkBitmap() in which case calling // isNull() on the returned bitmap will return true. -SkBitmap GrabPhishingThumbnail(RenderView* render_view, + SkBitmap GrabPhishingThumbnail(content::RenderView* render_view, const gfx::Size& view_size, const gfx::Size& thumbnail_size); diff --git a/chrome/renderer/search_extension.cc b/chrome/renderer/search_extension.cc index 384e944..01e3a7d 100644 --- a/chrome/renderer/search_extension.cc +++ b/chrome/renderer/search_extension.cc @@ -9,7 +9,7 @@ #include "base/command_line.h" #include "chrome/renderer/searchbox.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "v8/include/v8.h" @@ -30,7 +30,7 @@ class SearchExtensionWrapper : public v8::Extension { v8::Handle<v8::String> name); // Helper function to find the RenderView. May return NULL. - static RenderView* GetRenderView(); + static content::RenderView* GetRenderView(); // Implementation of window.chrome.setSuggestResult. static v8::Handle<v8::Value> SetSuggestResult(const v8::Arguments& args); @@ -60,7 +60,7 @@ v8::Handle<v8::FunctionTemplate> SearchExtensionWrapper::GetNativeFunction( } // static -RenderView* SearchExtensionWrapper::GetRenderView() { +content::RenderView* SearchExtensionWrapper::GetRenderView() { WebFrame* webframe = WebFrame::frameForEnteredContext(); DCHECK(webframe) << "There should be an active frame since we just got " "a native function called."; @@ -69,7 +69,7 @@ RenderView* SearchExtensionWrapper::GetRenderView() { WebView* webview = webframe->view(); if (!webview) return NULL; // can happen during closing - return RenderView::FromWebView(webview); + return content::RenderView::FromWebView(webview); } // static @@ -77,7 +77,7 @@ v8::Handle<v8::Value> SearchExtensionWrapper::SetSuggestResult( const v8::Arguments& args) { if (!args.Length() || !args[0]->IsString()) return v8::Undefined(); - RenderView* render_view = GetRenderView(); + content::RenderView* render_view = GetRenderView(); if (!render_view) return v8::Undefined(); std::vector<std::string> suggestions; diff --git a/chrome/renderer/searchbox.cc b/chrome/renderer/searchbox.cc index 01fe554..18089b9 100644 --- a/chrome/renderer/searchbox.cc +++ b/chrome/renderer/searchbox.cc @@ -6,12 +6,12 @@ #include "chrome/common/render_messages.h" #include "chrome/renderer/searchbox_extension.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" using WebKit::WebView; -SearchBox::SearchBox(RenderView* render_view) +SearchBox::SearchBox(content::RenderView* render_view) : content::RenderViewObserver(render_view), content::RenderViewObserverTracker<SearchBox>(render_view), verbatim_(false), @@ -26,7 +26,7 @@ void SearchBox::SetSuggestions(const std::vector<std::string>& suggestions, InstantCompleteBehavior behavior) { // Explicitly allow empty vector to be sent to the browser. render_view()->Send(new ChromeViewHostMsg_SetSuggestions( - render_view()->routing_id(), render_view()->page_id(), suggestions, + render_view()->GetRoutingId(), render_view()->GetPageId(), suggestions, behavior)); } @@ -52,37 +52,37 @@ void SearchBox::OnChange(const string16& value, verbatim_ = verbatim; selection_start_ = selection_start; selection_end_ = selection_end; - if (!render_view()->webview() || !render_view()->webview()->mainFrame()) + if (!render_view()->GetWebView() || !render_view()->GetWebView()->mainFrame()) return; extensions_v8::SearchBoxExtension::DispatchChange( - render_view()->webview()->mainFrame()); + render_view()->GetWebView()->mainFrame()); } void SearchBox::OnSubmit(const string16& value, bool verbatim) { value_ = value; verbatim_ = verbatim; - if (render_view()->webview() && render_view()->webview()->mainFrame()) { + if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) { extensions_v8::SearchBoxExtension::DispatchSubmit( - render_view()->webview()->mainFrame()); + render_view()->GetWebView()->mainFrame()); } Reset(); } void SearchBox::OnCancel() { verbatim_ = false; - if (render_view()->webview() && render_view()->webview()->mainFrame()) { + if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) { extensions_v8::SearchBoxExtension::DispatchCancel( - render_view()->webview()->mainFrame()); + render_view()->GetWebView()->mainFrame()); } Reset(); } void SearchBox::OnResize(const gfx::Rect& bounds) { rect_ = bounds; - if (!render_view()->webview() || !render_view()->webview()->mainFrame()) + if (!render_view()->GetWebView() || !render_view()->GetWebView()->mainFrame()) return; extensions_v8::SearchBoxExtension::DispatchResize( - render_view()->webview()->mainFrame()); + render_view()->GetWebView()->mainFrame()); } void SearchBox::OnDetermineIfPageSupportsInstant(const string16& value, @@ -94,9 +94,9 @@ void SearchBox::OnDetermineIfPageSupportsInstant(const string16& value, selection_start_ = selection_start; selection_end_ = selection_end; bool result = extensions_v8::SearchBoxExtension::PageSupportsInstant( - render_view()->webview()->mainFrame()); + render_view()->GetWebView()->mainFrame()); render_view()->Send(new ChromeViewHostMsg_InstantSupportDetermined( - render_view()->routing_id(), render_view()->page_id(), result)); + render_view()->GetRoutingId(), render_view()->GetPageId(), result)); } void SearchBox::Reset() { diff --git a/chrome/renderer/searchbox.h b/chrome/renderer/searchbox.h index 2e63e7f..630d48d 100644 --- a/chrome/renderer/searchbox.h +++ b/chrome/renderer/searchbox.h @@ -18,7 +18,7 @@ class SearchBox : public content::RenderViewObserver, public content::RenderViewObserverTracker<SearchBox> { public: - explicit SearchBox(RenderView* render_view); + explicit SearchBox(content::RenderView* render_view); virtual ~SearchBox(); // Sends ViewHostMsg_SetSuggestions to the browser. diff --git a/chrome/renderer/searchbox_extension.cc b/chrome/renderer/searchbox_extension.cc index 42641d1..f5fd355 100644 --- a/chrome/renderer/searchbox_extension.cc +++ b/chrome/renderer/searchbox_extension.cc @@ -11,7 +11,7 @@ #include "base/string_split.h" #include "base/stringprintf.h" #include "chrome/renderer/searchbox.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" @@ -132,7 +132,7 @@ class SearchBoxExtensionWrapper : public v8::Extension { v8::Handle<v8::String> name); // Helper function to find the RenderView. May return NULL. - static RenderView* GetRenderView(); + static content::RenderView* GetRenderView(); // Gets the value of the user's search query. static v8::Handle<v8::Value> GetValue(const v8::Arguments& args); @@ -197,7 +197,7 @@ v8::Handle<v8::FunctionTemplate> SearchBoxExtensionWrapper::GetNativeFunction( } // static -RenderView* SearchBoxExtensionWrapper::GetRenderView() { +content::RenderView* SearchBoxExtensionWrapper::GetRenderView() { WebFrame* webframe = WebFrame::frameForEnteredContext(); DCHECK(webframe) << "There should be an active frame since we just got " "a native function called."; @@ -206,13 +206,13 @@ RenderView* SearchBoxExtensionWrapper::GetRenderView() { WebView* webview = webframe->view(); if (!webview) return NULL; // can happen during closing - return RenderView::FromWebView(webview); + return content::RenderView::FromWebView(webview); } // static v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetValue( const v8::Arguments& args) { - RenderView* render_view = GetRenderView(); + content::RenderView* render_view = GetRenderView(); if (!render_view) return v8::Undefined(); return v8::String::New( reinterpret_cast<const uint16_t*>( @@ -223,7 +223,7 @@ v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetValue( // static v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetVerbatim( const v8::Arguments& args) { - RenderView* render_view = GetRenderView(); + content::RenderView* render_view = GetRenderView(); if (!render_view) return v8::Undefined(); return v8::Boolean::New(SearchBox::Get(render_view)->verbatim()); } @@ -231,7 +231,7 @@ v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetVerbatim( // static v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetSelectionStart( const v8::Arguments& args) { - RenderView* render_view = GetRenderView(); + content::RenderView* render_view = GetRenderView(); if (!render_view) return v8::Undefined(); return v8::Int32::New(SearchBox::Get(render_view)->selection_start()); } @@ -239,7 +239,7 @@ v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetSelectionStart( // static v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetSelectionEnd( const v8::Arguments& args) { - RenderView* render_view = GetRenderView(); + content::RenderView* render_view = GetRenderView(); if (!render_view) return v8::Undefined(); return v8::Int32::New(SearchBox::Get(render_view)->selection_end()); } @@ -247,7 +247,7 @@ v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetSelectionEnd( // static v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetX( const v8::Arguments& args) { - RenderView* render_view = GetRenderView(); + content::RenderView* render_view = GetRenderView(); if (!render_view) return v8::Undefined(); return v8::Int32::New(SearchBox::Get(render_view)->rect().x()); } @@ -255,7 +255,7 @@ v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetX( // static v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetY( const v8::Arguments& args) { - RenderView* render_view = GetRenderView(); + content::RenderView* render_view = GetRenderView(); if (!render_view) return v8::Undefined(); return v8::Int32::New(SearchBox::Get(render_view)->rect().y()); } @@ -263,7 +263,7 @@ v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetY( // static v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetWidth( const v8::Arguments& args) { - RenderView* render_view = GetRenderView(); + content::RenderView* render_view = GetRenderView(); if (!render_view) return v8::Undefined(); return v8::Int32::New(SearchBox::Get(render_view)->rect().width()); } @@ -271,7 +271,7 @@ v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetWidth( // static v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetHeight( const v8::Arguments& args) { - RenderView* render_view = GetRenderView(); + content::RenderView* render_view = GetRenderView(); if (!render_view) return v8::Undefined(); return v8::Int32::New(SearchBox::Get(render_view)->rect().height()); } @@ -343,7 +343,7 @@ v8::Handle<v8::Value> SearchBoxExtensionWrapper::SetSuggestions( } } - if (RenderView* render_view = GetRenderView()) + if (content::RenderView* render_view = GetRenderView()) SearchBox::Get(render_view)->SetSuggestions(suggestions, behavior); return v8::Undefined(); } diff --git a/chrome/renderer/spellchecker/spellcheck_provider.cc b/chrome/renderer/spellchecker/spellcheck_provider.cc index 794b204..bb4d378 100644 --- a/chrome/renderer/spellchecker/spellcheck_provider.cc +++ b/chrome/renderer/spellchecker/spellcheck_provider.cc @@ -8,7 +8,7 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/spellcheck_messages.h" #include "chrome/renderer/spellchecker/spellcheck.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextCheckingCompletion.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextCheckingResult.h" @@ -21,7 +21,7 @@ using WebKit::WebTextCheckingCompletion; using WebKit::WebTextCheckingResult; using WebKit::WebVector; -SpellCheckProvider::SpellCheckProvider(RenderView* render_view, +SpellCheckProvider::SpellCheckProvider(content::RenderView* render_view, SpellCheck* spellcheck) : content::RenderViewObserver(render_view), #if defined(OS_MACOSX) @@ -31,7 +31,7 @@ SpellCheckProvider::SpellCheckProvider(RenderView* render_view, spelling_panel_visible_(false), spellcheck_(spellcheck) { if (render_view) // NULL in unit tests. - render_view->webview()->setSpellCheckClient(this); + render_view->GetWebView()->setSpellCheckClient(this); } SpellCheckProvider::~SpellCheckProvider() { @@ -85,8 +85,8 @@ void SpellCheckProvider::FocusedNodeChanged(const WebKit::WebNode& unused) { enabled = render_view()->IsEditableNode(node); bool checked = false; - if (enabled && render_view()->webview()) { - WebFrame* frame = render_view()->webview()->focusedFrame(); + if (enabled && render_view()->GetWebView()) { + WebFrame* frame = render_view()->GetWebView()->focusedFrame(); if (frame->isContinuousSpellCheckingEnabled()) checked = true; } @@ -154,9 +154,9 @@ bool SpellCheckProvider::is_using_platform_spelling_engine() const { } void SpellCheckProvider::OnAdvanceToNextMisspelling() { - if (!render_view()->webview()) + if (!render_view()->GetWebView()) return; - render_view()->webview()->focusedFrame()->executeCommand( + render_view()->GetWebView()->focusedFrame()->executeCommand( WebString::fromUTF8("AdvanceToNextMisspelling")); } @@ -173,20 +173,20 @@ void SpellCheckProvider::OnRespondTextCheck( } void SpellCheckProvider::OnToggleSpellPanel(bool is_currently_visible) { - if (!render_view()->webview()) + if (!render_view()->GetWebView()) return; // We need to tell the webView whether the spelling panel is visible or not so // that it won't need to make ipc calls later. spelling_panel_visible_ = is_currently_visible; - render_view()->webview()->focusedFrame()->executeCommand( + render_view()->GetWebView()->focusedFrame()->executeCommand( WebString::fromUTF8("ToggleSpellPanel")); } void SpellCheckProvider::OnToggleSpellCheck() { - if (!render_view()->webview()) + if (!render_view()->GetWebView()) return; - WebFrame* frame = render_view()->webview()->focusedFrame(); + WebFrame* frame = render_view()->GetWebView()->focusedFrame(); frame->enableContinuousSpellChecking( !frame->isContinuousSpellCheckingEnabled()); } diff --git a/chrome/renderer/spellchecker/spellcheck_provider.h b/chrome/renderer/spellchecker/spellcheck_provider.h index a2b29f7..7dc6384 100644 --- a/chrome/renderer/spellchecker/spellcheck_provider.h +++ b/chrome/renderer/spellchecker/spellcheck_provider.h @@ -28,7 +28,7 @@ class SpellCheckProvider : public content::RenderViewObserver, public: typedef IDMap<WebKit::WebTextCheckingCompletion> WebTextCheckCompletions; - SpellCheckProvider(RenderView* render_view, SpellCheck* spellcheck); + SpellCheckProvider(content::RenderView* render_view, SpellCheck* spellcheck); virtual ~SpellCheckProvider(); // Requests async spell and grammar checker to the platform text diff --git a/chrome/renderer/translate_helper.cc b/chrome/renderer/translate_helper.cc index 53708d7..5281b16 100644 --- a/chrome/renderer/translate_helper.cc +++ b/chrome/renderer/translate_helper.cc @@ -11,7 +11,7 @@ #include "chrome/common/chrome_constants.h" #include "chrome/common/render_messages.h" #include "chrome/renderer/autofill/autofill_agent.h" -#include "content/renderer/render_view.h" +#include "content/public/renderer/render_view.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" @@ -46,7 +46,7 @@ static const char* const kAutoDetectionLanguage = "auto"; //////////////////////////////////////////////////////////////////////////////// // TranslateHelper, public: // -TranslateHelper::TranslateHelper(RenderView* render_view, +TranslateHelper::TranslateHelper(content::RenderView* render_view, autofill::AutofillAgent* autofill) : content::RenderViewObserver(render_view), translation_pending_(false), @@ -59,7 +59,7 @@ TranslateHelper::~TranslateHelper() { } void TranslateHelper::PageCaptured(const string16& contents) { - WebDocument document = render_view()->webview()->mainFrame()->document(); + WebDocument document = render_view()->GetWebView()->mainFrame()->document(); // If the page explicitly specifies a language, use it, otherwise we'll // determine it based on the text content using the CLD. std::string language = GetPageLanguageFromMetaTag(&document); @@ -246,7 +246,7 @@ void TranslateHelper::OnTranslatePage(int page_id, const std::string& translate_script, const std::string& source_lang, const std::string& target_lang) { - if (render_view()->page_id() != page_id) + if (render_view()->GetPageId() != page_id) return; // We navigated away, nothing to do. if (translation_pending_ && page_id == page_id_ && @@ -278,7 +278,7 @@ void TranslateHelper::OnTranslatePage(int page_id, } void TranslateHelper::OnRevertTranslation(int page_id) { - if (render_view()->page_id() != page_id) + if (render_view()->GetPageId() != page_id) return; // We navigated away, nothing to do. if (!IsTranslateLibAvailable()) { @@ -299,7 +299,7 @@ void TranslateHelper::OnRevertTranslation(int page_id) { void TranslateHelper::CheckTranslateStatus() { // If this is not the same page, the translation has been canceled. If the // view is gone, the page is closing. - if (page_id_ != render_view()->page_id() || !render_view()->webview()) + if (page_id_ != render_view()->GetPageId() || !render_view()->GetWebView()) return; // First check if there was an error. @@ -333,11 +333,11 @@ void TranslateHelper::CheckTranslateStatus() { translation_pending_ = false; if (autofill_) - autofill_->FrameTranslated(render_view()->webview()->mainFrame()); + autofill_->FrameTranslated(render_view()->GetWebView()->mainFrame()); // Notify the browser we are done. render_view()->Send(new ChromeViewHostMsg_PageTranslated( - render_view()->routing_id(), render_view()->page_id(), + render_view()->GetRoutingId(), render_view()->GetPageId(), actual_source_lang, target_lang_, TranslateErrors::NONE)); return; } @@ -394,7 +394,7 @@ bool TranslateHelper::ExecuteScriptAndGetStringResult(const std::string& script, void TranslateHelper::TranslatePageImpl(int count) { DCHECK_LT(count, kMaxTranslateInitCheckAttempts); - if (page_id_ != render_view()->page_id() || !render_view()->webview()) + if (page_id_ != render_view()->GetPageId() || !render_view()->GetWebView()) return; if (!IsTranslateLibReady()) { @@ -426,11 +426,12 @@ void TranslateHelper::NotifyBrowserTranslationFailed( translation_pending_ = false; // Notify the browser there was an error. render_view()->Send(new ChromeViewHostMsg_PageTranslated( - render_view()->routing_id(), page_id_, source_lang_, target_lang_, error)); + render_view()->GetRoutingId(), page_id_, source_lang_, + target_lang_, error)); } WebFrame* TranslateHelper::GetMainFrame() { - WebView* web_view = render_view()->webview(); + WebView* web_view = render_view()->GetWebView(); if (!web_view) { // When the WebView is going away, the render view should have called // CancelPendingTranslation() which should have stopped any pending work, so diff --git a/chrome/renderer/translate_helper.h b/chrome/renderer/translate_helper.h index 31b8979..c0c7f9f 100644 --- a/chrome/renderer/translate_helper.h +++ b/chrome/renderer/translate_helper.h @@ -27,7 +27,8 @@ class AutofillAgent; class TranslateHelper : public content::RenderViewObserver { public: // autofill can be NULL. - TranslateHelper(RenderView* render_view, autofill::AutofillAgent* autofill); + TranslateHelper(content::RenderView* render_view, + autofill::AutofillAgent* autofill); virtual ~TranslateHelper(); // Informs us that the page's text has been extracted. diff --git a/chrome/renderer/translate_helper_browsertest.cc b/chrome/renderer/translate_helper_browsertest.cc index e16e44d..3a5b957 100644 --- a/chrome/renderer/translate_helper_browsertest.cc +++ b/chrome/renderer/translate_helper_browsertest.cc @@ -87,13 +87,14 @@ TEST_F(TranslateHelperTest, TranslateLibNeverReady) { // translate_helper.cc .WillRepeatedly(Return(false)); - translate_helper_->TranslatePage(view_->page_id(), "en", "fr", std::string()); + translate_helper_->TranslatePage( + view_->GetPageId(), "en", "fr", std::string()); MessageLoop::current()->RunAllPending(); int page_id; TranslateErrors::Type error; ASSERT_TRUE(GetPageTranslatedMessage(&page_id, NULL, NULL, &error)); - EXPECT_EQ(view_->page_id(), page_id); + EXPECT_EQ(view_->GetPageId(), page_id); EXPECT_EQ(TranslateErrors::INITIALIZATION_ERROR, error); } @@ -122,8 +123,8 @@ TEST_F(TranslateHelperTest, TranslateSuccess) { std::string original_lang("en"); std::string target_lang("fr"); - translate_helper_->TranslatePage(view_->page_id(), original_lang, target_lang, - std::string()); + translate_helper_->TranslatePage( + view_->GetPageId(), original_lang, target_lang, std::string()); MessageLoop::current()->RunAllPending(); int page_id; @@ -134,7 +135,7 @@ TEST_F(TranslateHelperTest, TranslateSuccess) { &received_original_lang, &received_target_lang, &error)); - EXPECT_EQ(view_->page_id(), page_id); + EXPECT_EQ(view_->GetPageId(), page_id); EXPECT_EQ(original_lang, received_original_lang); EXPECT_EQ(target_lang, received_target_lang); EXPECT_EQ(TranslateErrors::NONE, error); @@ -165,13 +166,14 @@ TEST_F(TranslateHelperTest, TranslateFailure) { .Times(AtLeast(1)) .WillRepeatedly(Return(false)); - translate_helper_->TranslatePage(view_->page_id(), "en", "fr", std::string()); + translate_helper_->TranslatePage( + view_->GetPageId(), "en", "fr", std::string()); MessageLoop::current()->RunAllPending(); int page_id; TranslateErrors::Type error; ASSERT_TRUE(GetPageTranslatedMessage(&page_id, NULL, NULL, &error)); - EXPECT_EQ(view_->page_id(), page_id); + EXPECT_EQ(view_->GetPageId(), page_id); EXPECT_EQ(TranslateErrors::TRANSLATION_ERROR, error); } @@ -197,7 +199,7 @@ TEST_F(TranslateHelperTest, UndefinedSourceLang) { .Times(AtLeast(1)) .WillRepeatedly(Return(true)); - translate_helper_->TranslatePage(view_->page_id(), + translate_helper_->TranslatePage(view_->GetPageId(), chrome::kUnknownLanguageCode, "fr", std::string()); MessageLoop::current()->RunAllPending(); @@ -208,7 +210,7 @@ TEST_F(TranslateHelperTest, UndefinedSourceLang) { std::string target_lang; ASSERT_TRUE(GetPageTranslatedMessage(&page_id, &original_lang, &target_lang, &error)); - EXPECT_EQ(view_->page_id(), page_id); + EXPECT_EQ(view_->GetPageId(), page_id); EXPECT_EQ("de", original_lang); EXPECT_EQ("fr", target_lang); EXPECT_EQ(TranslateErrors::NONE, error); @@ -234,12 +236,12 @@ TEST_F(TranslateHelperTest, MultipleSimilarTranslations) { std::string original_lang("en"); std::string target_lang("fr"); - translate_helper_->TranslatePage(view_->page_id(), original_lang, target_lang, - std::string()); + translate_helper_->TranslatePage( + view_->GetPageId(), original_lang, target_lang, std::string()); // While this is running call again TranslatePage to make sure noting bad // happens. - translate_helper_->TranslatePage(view_->page_id(), original_lang, target_lang, - std::string()); + translate_helper_->TranslatePage( + view_->GetPageId(), original_lang, target_lang, std::string()); MessageLoop::current()->RunAllPending(); int page_id; @@ -250,7 +252,7 @@ TEST_F(TranslateHelperTest, MultipleSimilarTranslations) { &received_original_lang, &received_target_lang, &error)); - EXPECT_EQ(view_->page_id(), page_id); + EXPECT_EQ(view_->GetPageId(), page_id); EXPECT_EQ(original_lang, received_original_lang); EXPECT_EQ(target_lang, received_target_lang); EXPECT_EQ(TranslateErrors::NONE, error); @@ -272,12 +274,12 @@ TEST_F(TranslateHelperTest, MultipleDifferentTranslations) { std::string original_lang("en"); std::string target_lang("fr"); - translate_helper_->TranslatePage(view_->page_id(), original_lang, target_lang, - std::string()); + translate_helper_->TranslatePage( + view_->GetPageId(), original_lang, target_lang, std::string()); // While this is running call again TranslatePage with a new target lang. std::string new_target_lang("de"); - translate_helper_->TranslatePage(view_->page_id(), original_lang, - new_target_lang, std::string()); + translate_helper_->TranslatePage( + view_->GetPageId(), original_lang, new_target_lang, std::string()); MessageLoop::current()->RunAllPending(); int page_id; @@ -288,7 +290,7 @@ TEST_F(TranslateHelperTest, MultipleDifferentTranslations) { &received_original_lang, &received_target_lang, &error)); - EXPECT_EQ(view_->page_id(), page_id); + EXPECT_EQ(view_->GetPageId(), page_id); EXPECT_EQ(original_lang, received_original_lang); EXPECT_EQ(new_target_lang, received_target_lang); EXPECT_EQ(TranslateErrors::NONE, error); |