summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/debugger/debugger_remote_service.cc1
-rw-r--r--chrome/browser/debugger/extension_ports_remote_service.cc1
-rw-r--r--chrome/browser/search_engines/search_provider_install_state_message_filter.cc21
-rw-r--r--chrome/browser/search_engines/search_provider_install_state_message_filter.h8
-rw-r--r--chrome/browser/ui/search_engines/search_engine_tab_helper.cc10
-rw-r--r--chrome/browser/ui/search_engines/search_engine_tab_helper.h4
-rw-r--r--chrome/chrome_common.gypi3
-rw-r--r--chrome/common/render_messages.h15
-rw-r--r--chrome/common/render_messages_params.cc88
-rw-r--r--chrome/common/render_messages_params.h120
-rw-r--r--chrome/common/search_provider.h45
-rw-r--r--chrome/renderer/extensions/extension_process_bindings.cc1
-rw-r--r--chrome/renderer/external_extension.cc17
-rw-r--r--chrome/renderer/safe_browsing/render_view_fake_resources_test.cc1
-rw-r--r--chrome/renderer/search_extension.cc1
-rw-r--r--chrome/renderer/searchbox_extension.cc1
-rw-r--r--content/browser/plugin_process_host.cc1
-rw-r--r--content/browser/renderer_host/render_view_host_delegate.cc1
-rw-r--r--content/browser/renderer_host/render_widget_helper.cc1
-rw-r--r--content/browser/renderer_host/resource_dispatcher_host_unittest.cc1
-rw-r--r--content/browser/tab_contents/navigation_controller_unittest.cc1
-rw-r--r--content/renderer/pepper_plugin_delegate_impl.cc1
-rw-r--r--content/renderer/render_view.cc15
-rw-r--r--content/renderer/render_view.h13
-rw-r--r--content/renderer/render_view_browsertest.cc1
-rw-r--r--content/renderer/render_widget.cc1
26 files changed, 94 insertions, 279 deletions
diff --git a/chrome/browser/debugger/debugger_remote_service.cc b/chrome/browser/debugger/debugger_remote_service.cc
index d5e12b7..6c21e2e 100644
--- a/chrome/browser/debugger/debugger_remote_service.cc
+++ b/chrome/browser/debugger/debugger_remote_service.cc
@@ -18,7 +18,6 @@
#include "chrome/browser/debugger/inspectable_tab_proxy.h"
#include "chrome/common/devtools_messages.h"
#include "chrome/common/render_messages.h"
-#include "chrome/common/render_messages_params.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/tab_contents.h"
diff --git a/chrome/browser/debugger/extension_ports_remote_service.cc b/chrome/browser/debugger/extension_ports_remote_service.cc
index a340ca6e..b769ca0 100644
--- a/chrome/browser/debugger/extension_ports_remote_service.cc
+++ b/chrome/browser/debugger/extension_ports_remote_service.cc
@@ -22,7 +22,6 @@
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/devtools_messages.h"
#include "chrome/common/extensions/extension_messages.h"
-#include "chrome/common/render_messages_params.h"
#include "content/browser/tab_contents/tab_contents.h"
namespace {
diff --git a/chrome/browser/search_engines/search_provider_install_state_message_filter.cc b/chrome/browser/search_engines/search_provider_install_state_message_filter.cc
index 3f912ec..3e712e0 100644
--- a/chrome/browser/search_engines/search_provider_install_state_message_filter.cc
+++ b/chrome/browser/search_engines/search_provider_install_state_message_filter.cc
@@ -7,7 +7,6 @@
#include "base/logging.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/render_messages.h"
-#include "chrome/common/render_messages_params.h"
#include "content/browser/renderer_host/render_process_host.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/common/notification_source.h"
@@ -49,7 +48,7 @@ bool SearchProviderInstallStateMessageFilter::OnMessageReceived(
return handled;
}
-ViewHostMsg_GetSearchProviderInstallState_Params
+search_provider::InstallState
SearchProviderInstallStateMessageFilter::GetSearchProviderInstallState(
const GURL& page_location,
const GURL& requested_host) {
@@ -57,31 +56,27 @@ SearchProviderInstallStateMessageFilter::GetSearchProviderInstallState(
// Do the security check before any others to avoid information leaks.
if (page_location.GetOrigin() != requested_origin)
- return ViewHostMsg_GetSearchProviderInstallState_Params::Denied();
+ return search_provider::DENIED;
// In incognito mode, no search information is exposed. (This check must be
// done after the security check or else a web site can detect that the
// user is in incognito mode just by doing a cross origin request.)
if (is_off_the_record_)
- return ViewHostMsg_GetSearchProviderInstallState_Params::NotInstalled();
+ return search_provider::NOT_INSTALLED;
switch (provider_data_.GetInstallState(requested_origin)) {
case SearchProviderInstallData::NOT_INSTALLED:
- return ViewHostMsg_GetSearchProviderInstallState_Params::
- NotInstalled();
+ return search_provider::NOT_INSTALLED;
case SearchProviderInstallData::INSTALLED_BUT_NOT_DEFAULT:
- return ViewHostMsg_GetSearchProviderInstallState_Params::
- InstallButNotDefault();
+ return search_provider::INSTALLED_BUT_NOT_DEFAULT;
case SearchProviderInstallData::INSTALLED_AS_DEFAULT:
- return ViewHostMsg_GetSearchProviderInstallState_Params::
- InstalledAsDefault();
+ return search_provider::INSTALLED_AS_DEFAULT;
}
NOTREACHED();
- return ViewHostMsg_GetSearchProviderInstallState_Params::
- NotInstalled();
+ return search_provider::NOT_INSTALLED;
}
void
@@ -103,7 +98,7 @@ void SearchProviderInstallStateMessageFilter::ReplyWithProviderInstallState(
const GURL& requested_host,
IPC::Message* reply_msg) {
DCHECK(reply_msg);
- ViewHostMsg_GetSearchProviderInstallState_Params install_state =
+ search_provider::InstallState install_state =
GetSearchProviderInstallState(page_location, requested_host);
ViewHostMsg_GetSearchProviderInstallState::WriteReplyParams(
diff --git a/chrome/browser/search_engines/search_provider_install_state_message_filter.h b/chrome/browser/search_engines/search_provider_install_state_message_filter.h
index 3295a60..130841f 100644
--- a/chrome/browser/search_engines/search_provider_install_state_message_filter.h
+++ b/chrome/browser/search_engines/search_provider_install_state_message_filter.h
@@ -6,11 +6,11 @@
#define CHROME_BROWSER_SEARCH_ENGINES_SEARCH_PROVIDER_INSTALL_STATE_MESSAGE_FILTER_H_
#include "chrome/browser/search_engines/search_provider_install_data.h"
+#include "chrome/common/search_provider.h"
#include "content/browser/browser_message_filter.h"
class GURL;
class Profile;
-struct ViewHostMsg_GetSearchProviderInstallState_Params;
// Handles messages regarding search provider install state on the I/O thread.
class SearchProviderInstallStateMessageFilter : public BrowserMessageFilter {
@@ -26,9 +26,9 @@ class SearchProviderInstallStateMessageFilter : public BrowserMessageFilter {
private:
// Figures out the install state for the search provider.
- ViewHostMsg_GetSearchProviderInstallState_Params
- GetSearchProviderInstallState(const GURL& page_location,
- const GURL& requested_host);
+ search_provider::InstallState GetSearchProviderInstallState(
+ const GURL& page_location,
+ const GURL& requested_host);
// Starts handling the message requesting the search provider install state.
void OnMsgGetSearchProviderInstallState(const GURL& page_location,
diff --git a/chrome/browser/ui/search_engines/search_engine_tab_helper.cc b/chrome/browser/ui/search_engines/search_engine_tab_helper.cc
index 670a36f..99dbc96 100644
--- a/chrome/browser/ui/search_engines/search_engine_tab_helper.cc
+++ b/chrome/browser/ui/search_engines/search_engine_tab_helper.cc
@@ -50,7 +50,7 @@ bool SearchEngineTabHelper::OnMessageReceived(const IPC::Message& message) {
void SearchEngineTabHelper::OnPageHasOSDD(
int32 page_id,
const GURL& doc_url,
- const ViewHostMsg_PageHasOSDD_Type& msg_provider_type) {
+ const search_provider::OSDDType& msg_provider_type) {
// Checks to see if we should generate a keyword based on the OSDD, and if
// necessary uses TemplateURLFetcher to download the OSDD and create a
// keyword.
@@ -65,16 +65,16 @@ void SearchEngineTabHelper::OnPageHasOSDD(
return;
TemplateURLFetcher::ProviderType provider_type;
- switch (msg_provider_type.type) {
- case ViewHostMsg_PageHasOSDD_Type::AUTODETECTED_PROVIDER:
+ switch (msg_provider_type) {
+ case search_provider::AUTODETECTED_PROVIDER:
provider_type = TemplateURLFetcher::AUTODETECTED_PROVIDER;
break;
- case ViewHostMsg_PageHasOSDD_Type::EXPLICIT_DEFAULT_PROVIDER:
+ case search_provider::EXPLICIT_DEFAULT_PROVIDER:
provider_type = TemplateURLFetcher::EXPLICIT_DEFAULT_PROVIDER;
break;
- case ViewHostMsg_PageHasOSDD_Type::EXPLICIT_PROVIDER:
+ case search_provider::EXPLICIT_PROVIDER:
provider_type = TemplateURLFetcher::EXPLICIT_PROVIDER;
break;
diff --git a/chrome/browser/ui/search_engines/search_engine_tab_helper.h b/chrome/browser/ui/search_engines/search_engine_tab_helper.h
index 90b088a..7e1d9c8 100644
--- a/chrome/browser/ui/search_engines/search_engine_tab_helper.h
+++ b/chrome/browser/ui/search_engines/search_engine_tab_helper.h
@@ -8,11 +8,11 @@
#include "chrome/browser/ui/find_bar/find_bar_controller.h"
#include "chrome/browser/ui/find_bar/find_notification_details.h"
+#include "chrome/common/search_provider.h"
#include "content/browser/tab_contents/tab_contents_observer.h"
class SearchEngineTabHelperDelegate;
class TabContentsWrapper;
-struct ViewHostMsg_PageHasOSDD_Type;
// Per-tab search engine manager. Handles dealing search engine processing
// functionality.
@@ -34,7 +34,7 @@ class SearchEngineTabHelper : public TabContentsObserver {
// Handles when a page specifies an OSDD (OpenSearch Description Document).
void OnPageHasOSDD(int32 page_id,
const GURL& doc_url,
- const ViewHostMsg_PageHasOSDD_Type& msg_provider_type);
+ const search_provider::OSDDType& msg_provider_type);
// If params has a searchable form, this tries to create a new keyword.
void GenerateKeywordIfNecessary(
diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi
index 47bff48..c3d3e48 100644
--- a/chrome/chrome_common.gypi
+++ b/chrome/chrome_common.gypi
@@ -211,8 +211,7 @@
'common/remoting/chromoting_host_info.h',
'common/render_messages.cc',
'common/render_messages.h',
- 'common/render_messages_params.cc',
- 'common/render_messages_params.h',
+ 'common/search_provider.h',
'common/security_style.h',
'common/service_messages.h',
'common/service_process_util.cc',
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index 5bc6626..61272d4 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -20,7 +20,7 @@
#include "chrome/common/content_settings.h"
#include "chrome/common/instant_types.h"
#include "chrome/common/nacl_types.h"
-#include "chrome/common/render_messages_params.h"
+#include "chrome/common/search_provider.h"
#include "chrome/common/thumbnail_score.h"
#include "chrome/common/translate_errors.h"
#include "chrome/common/view_types.h"
@@ -100,6 +100,8 @@ struct ParamTraits<ContentSettings> {
IPC_ENUM_TRAITS(ContentSetting)
IPC_ENUM_TRAITS(ContentSettingsType)
IPC_ENUM_TRAITS(InstantCompleteBehavior)
+IPC_ENUM_TRAITS(search_provider::OSDDType)
+IPC_ENUM_TRAITS(search_provider::InstallState)
IPC_ENUM_TRAITS(TranslateErrors::Type)
IPC_ENUM_TRAITS(ViewType::Type)
IPC_ENUM_TRAITS(WebKit::WebConsoleMessage::Level)
@@ -372,15 +374,14 @@ IPC_SYNC_MESSAGE_CONTROL2_3(ViewHostMsg_LaunchNaCl,
IPC_MESSAGE_ROUTED3(ViewHostMsg_PageHasOSDD,
int32 /* page_id */,
GURL /* url of OS description document */,
- ViewHostMsg_PageHasOSDD_Type)
+ search_provider::OSDDType)
// Find out if the given url's security origin is installed as a search
// provider.
-IPC_SYNC_MESSAGE_ROUTED2_1(
- ViewHostMsg_GetSearchProviderInstallState,
- GURL /* page url */,
- GURL /* inquiry url */,
- ViewHostMsg_GetSearchProviderInstallState_Params /* install */)
+IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_GetSearchProviderInstallState,
+ GURL /* page url */,
+ GURL /* inquiry url */,
+ search_provider::InstallState /* install */)
// Stores new inspector setting in the profile.
IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateInspectorSetting,
diff --git a/chrome/common/render_messages_params.cc b/chrome/common/render_messages_params.cc
deleted file mode 100644
index 71824db..0000000
--- a/chrome/common/render_messages_params.cc
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/common/render_messages_params.h"
-
-#include "chrome/common/render_messages.h"
-
-namespace IPC {
-
-void ParamTraits<ViewHostMsg_PageHasOSDD_Type>::Write(Message* m,
- const param_type& p) {
- m->WriteInt(p.type);
-}
-
-bool ParamTraits<ViewHostMsg_PageHasOSDD_Type>::Read(const Message* m,
- void** iter,
- param_type* p) {
- int type;
- if (!m->ReadInt(iter, &type))
- return false;
- p->type = static_cast<param_type::Type>(type);
- return true;
-}
-
-void ParamTraits<ViewHostMsg_PageHasOSDD_Type>::Log(const param_type& p,
- std::string* l) {
- std::string type;
- switch (p.type) {
- case ViewHostMsg_PageHasOSDD_Type::AUTODETECTED_PROVIDER:
- type = "ViewHostMsg_PageHasOSDD_Type::AUTODETECTED_PROVIDER";
- break;
- case ViewHostMsg_PageHasOSDD_Type::EXPLICIT_PROVIDER:
- type = "ViewHostMsg_PageHasOSDD_Type::EXPLICIT_PROVIDER";
- break;
- case ViewHostMsg_PageHasOSDD_Type::EXPLICIT_DEFAULT_PROVIDER:
- type = "ViewHostMsg_PageHasOSDD_Type::EXPLICIT_DEFAULT_PROVIDER";
- break;
- default:
- type = "UNKNOWN";
- break;
- }
- LogParam(type, l);
-}
-
-void ParamTraits<ViewHostMsg_GetSearchProviderInstallState_Params>::Write(
- Message* m, const param_type& p) {
- m->WriteInt(p.state);
-}
-
-bool ParamTraits<ViewHostMsg_GetSearchProviderInstallState_Params>::Read(
- const Message* m, void** iter, param_type* p) {
- int type;
- if (!m->ReadInt(iter, &type))
- return false;
- p->state = static_cast<param_type::State>(type);
- return true;
-}
-
-void ParamTraits<ViewHostMsg_GetSearchProviderInstallState_Params>::Log(
- const param_type& p, std::string* l) {
- std::string state;
- switch (p.state) {
- case ViewHostMsg_GetSearchProviderInstallState_Params::DENIED:
- state = "ViewHostMsg_GetSearchProviderInstallState_Params::DENIED";
- break;
- case ViewHostMsg_GetSearchProviderInstallState_Params::NOT_INSTALLED:
- state =
- "ViewHostMsg_GetSearchProviderInstallState_Params::NOT_INSTALLED";
- break;
- case ViewHostMsg_GetSearchProviderInstallState_Params::
- INSTALLED_BUT_NOT_DEFAULT:
- state = "ViewHostMsg_GetSearchProviderInstallState_Params::"
- "INSTALLED_BUT_NOT_DEFAULT";
- break;
- case ViewHostMsg_GetSearchProviderInstallState_Params::
- INSTALLED_AS_DEFAULT:
- state = "ViewHostMsg_GetSearchProviderInstallState_Params::"
- "INSTALLED_AS_DEFAULT";
- break;
- default:
- state = "UNKNOWN";
- break;
- }
- LogParam(state, l);
-}
-
-} // namespace IPC
diff --git a/chrome/common/render_messages_params.h b/chrome/common/render_messages_params.h
deleted file mode 100644
index 9e631a6..0000000
--- a/chrome/common/render_messages_params.h
+++ /dev/null
@@ -1,120 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_COMMON_RENDER_MESSAGES_PARAMS_H_
-#define CHROME_COMMON_RENDER_MESSAGES_PARAMS_H_
-#pragma once
-
-#include <string>
-
-#include "ipc/ipc_param_traits.h"
-
-// The type of OSDD that the renderer is giving to the browser.
-struct ViewHostMsg_PageHasOSDD_Type {
- enum Type {
- // The Open Search Description URL was detected automatically.
- AUTODETECTED_PROVIDER,
-
- // The Open Search Description URL was given by Javascript.
- EXPLICIT_PROVIDER,
-
- // The Open Search Description URL was given by Javascript to be the new
- // default search engine.
- EXPLICIT_DEFAULT_PROVIDER
- };
-
- Type type;
-
- ViewHostMsg_PageHasOSDD_Type() : type(AUTODETECTED_PROVIDER) {
- }
-
- explicit ViewHostMsg_PageHasOSDD_Type(Type t)
- : type(t) {
- }
-
- static ViewHostMsg_PageHasOSDD_Type Autodetected() {
- return ViewHostMsg_PageHasOSDD_Type(AUTODETECTED_PROVIDER);
- }
-
- static ViewHostMsg_PageHasOSDD_Type Explicit() {
- return ViewHostMsg_PageHasOSDD_Type(EXPLICIT_PROVIDER);
- }
-
- static ViewHostMsg_PageHasOSDD_Type ExplicitDefault() {
- return ViewHostMsg_PageHasOSDD_Type(EXPLICIT_DEFAULT_PROVIDER);
- }
-};
-
-// The install state of the search provider (not installed, installed, default).
-struct ViewHostMsg_GetSearchProviderInstallState_Params {
- enum State {
- // Equates to an access denied error.
- DENIED = -1,
-
- // DON'T CHANGE THE VALUES BELOW.
- // All of the following values are manidated by the
- // spec for window.external.IsSearchProviderInstalled.
-
- // The search provider is not installed.
- NOT_INSTALLED = 0,
-
- // The search provider is in the user's set but is not
- INSTALLED_BUT_NOT_DEFAULT = 1,
-
- // The search provider is set as the user's default.
- INSTALLED_AS_DEFAULT = 2
- };
- State state;
-
- ViewHostMsg_GetSearchProviderInstallState_Params()
- : state(DENIED) {
- }
-
- explicit ViewHostMsg_GetSearchProviderInstallState_Params(State s)
- : state(s) {
- }
-
- static ViewHostMsg_GetSearchProviderInstallState_Params Denied() {
- return ViewHostMsg_GetSearchProviderInstallState_Params(DENIED);
- }
-
- static ViewHostMsg_GetSearchProviderInstallState_Params NotInstalled() {
- return ViewHostMsg_GetSearchProviderInstallState_Params(NOT_INSTALLED);
- }
-
- static ViewHostMsg_GetSearchProviderInstallState_Params
- InstallButNotDefault() {
- return ViewHostMsg_GetSearchProviderInstallState_Params(
- INSTALLED_BUT_NOT_DEFAULT);
- }
-
- static ViewHostMsg_GetSearchProviderInstallState_Params InstalledAsDefault() {
- return ViewHostMsg_GetSearchProviderInstallState_Params(
- INSTALLED_AS_DEFAULT);
- }
-};
-
-namespace IPC {
-
-class Message;
-
-template <>
-struct ParamTraits<ViewHostMsg_PageHasOSDD_Type> {
- typedef ViewHostMsg_PageHasOSDD_Type param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, void** iter, param_type* p);
- static void Log(const param_type& p, std::string* l);
-};
-
-template <>
-struct ParamTraits<ViewHostMsg_GetSearchProviderInstallState_Params> {
- typedef ViewHostMsg_GetSearchProviderInstallState_Params param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, void** iter, param_type* p);
- static void Log(const param_type& p, std::string* l);
-};
-
-} // namespace IPC
-
-#endif // CHROME_COMMON_RENDER_MESSAGES_PARAMS_H_
diff --git a/chrome/common/search_provider.h b/chrome/common/search_provider.h
new file mode 100644
index 0000000..ad8fe63
--- /dev/null
+++ b/chrome/common/search_provider.h
@@ -0,0 +1,45 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_COMMON_SEARCH_PROVIDER_H_
+#define CHROME_COMMON_SEARCH_PROVIDER_H_
+#pragma once
+
+namespace search_provider {
+
+// The type of OSDD that the renderer is giving to the browser.
+enum OSDDType {
+ // The Open Search Description URL was detected automatically.
+ AUTODETECTED_PROVIDER,
+
+ // The Open Search Description URL was given by Javascript.
+ EXPLICIT_PROVIDER,
+
+ // The Open Search Description URL was given by Javascript to be the new
+ // default search engine.
+ EXPLICIT_DEFAULT_PROVIDER
+};
+
+// The install state of the search provider (not installed, installed, default).
+enum InstallState {
+ // Equates to an access denied error.
+ DENIED = -1,
+
+ // DON'T CHANGE THE VALUES BELOW.
+ // All of the following values are manidated by the
+ // spec for window.external.IsSearchProviderInstalled.
+
+ // The search provider is not installed.
+ NOT_INSTALLED = 0,
+
+ // The search provider is in the user's set but is not
+ INSTALLED_BUT_NOT_DEFAULT = 1,
+
+ // The search provider is set as the user's default.
+ INSTALLED_AS_DEFAULT = 2
+};
+
+} // namespace search_provider
+
+#endif // CHROME_COMMON_SEARCH_PROVIDER_H_
diff --git a/chrome/renderer/extensions/extension_process_bindings.cc b/chrome/renderer/extensions/extension_process_bindings.cc
index 510da83..9d58ed3 100644
--- a/chrome/renderer/extensions/extension_process_bindings.cc
+++ b/chrome/renderer/extensions/extension_process_bindings.cc
@@ -21,7 +21,6 @@
#include "chrome/common/extensions/extension_set.h"
#include "chrome/common/extensions/url_pattern.h"
#include "chrome/common/render_messages.h"
-#include "chrome/common/render_messages_params.h"
#include "chrome/common/url_constants.h"
#include "chrome/renderer/extensions/bindings_utils.h"
#include "chrome/renderer/extensions/event_bindings.h"
diff --git a/chrome/renderer/external_extension.cc b/chrome/renderer/external_extension.cc
index 86abf89..47d703b 100644
--- a/chrome/renderer/external_extension.cc
+++ b/chrome/renderer/external_extension.cc
@@ -6,7 +6,7 @@
#include "base/command_line.h"
#include "chrome/common/chrome_switches.h"
-#include "chrome/common/render_messages_params.h"
+#include "chrome/common/search_provider.h"
#include "content/renderer/render_view.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#include "v8/include/v8.h"
@@ -116,10 +116,10 @@ v8::Handle<v8::Value> ExternalExtensionWrapper::AddSearchProvider(
std::string name = std::string(*v8::String::Utf8Value(args[0]));
if (!name.length()) return v8::Undefined();
- ViewHostMsg_PageHasOSDD_Type provider_type =
+ search_provider::OSDDType provider_type =
((args.Length() < 2) || !args[1]->BooleanValue()) ?
- ViewHostMsg_PageHasOSDD_Type::Explicit() :
- ViewHostMsg_PageHasOSDD_Type::ExplicitDefault();
+ search_provider::EXPLICIT_PROVIDER :
+ search_provider::EXPLICIT_DEFAULT_PROVIDER;
RenderView* render_view = GetRenderView();
if (!render_view) return v8::Undefined();
@@ -142,14 +142,13 @@ v8::Handle<v8::Value> ExternalExtensionWrapper::IsSearchProviderInstalled(
WebFrame* webframe = WebFrame::frameForEnteredContext();
if (!webframe) return v8::Undefined();
- ViewHostMsg_GetSearchProviderInstallState_Params install
- = render_view->GetSearchProviderInstallState(webframe, name);
- if (install.state ==
- ViewHostMsg_GetSearchProviderInstallState_Params::DENIED) {
+ search_provider::InstallState install =
+ render_view->GetSearchProviderInstallState(webframe, name);
+ if (install == search_provider::DENIED) {
// FIXME: throw access denied exception.
return v8::ThrowException(v8::Exception::Error(v8::String::Empty()));
}
- return v8::Integer::New(install.state);
+ return v8::Integer::New(install);
}
v8::Extension* ExternalExtension::Get() {
diff --git a/chrome/renderer/safe_browsing/render_view_fake_resources_test.cc b/chrome/renderer/safe_browsing/render_view_fake_resources_test.cc
index 3659772..097f2e4 100644
--- a/chrome/renderer/safe_browsing/render_view_fake_resources_test.cc
+++ b/chrome/renderer/safe_browsing/render_view_fake_resources_test.cc
@@ -10,7 +10,6 @@
#include "base/process.h"
#include "base/shared_memory.h"
#include "chrome/common/render_messages.h"
-#include "chrome/common/render_messages_params.h"
#include "chrome/renderer/mock_render_process.h"
#include "chrome/renderer/render_thread.h"
#include "chrome/renderer/renderer_main_platform_delegate.h"
diff --git a/chrome/renderer/search_extension.cc b/chrome/renderer/search_extension.cc
index bdb4c97..2a73e89 100644
--- a/chrome/renderer/search_extension.cc
+++ b/chrome/renderer/search_extension.cc
@@ -8,7 +8,6 @@
#include <vector>
#include "base/command_line.h"
-#include "chrome/common/render_messages_params.h"
#include "chrome/renderer/searchbox.h"
#include "content/renderer/render_view.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
diff --git a/chrome/renderer/searchbox_extension.cc b/chrome/renderer/searchbox_extension.cc
index 4fe2552..b1b7980 100644
--- a/chrome/renderer/searchbox_extension.cc
+++ b/chrome/renderer/searchbox_extension.cc
@@ -10,7 +10,6 @@
#include "base/command_line.h"
#include "base/string_split.h"
#include "base/stringprintf.h"
-#include "chrome/common/render_messages_params.h"
#include "chrome/renderer/searchbox.h"
#include "content/renderer/render_view.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
diff --git a/content/browser/plugin_process_host.cc b/content/browser/plugin_process_host.cc
index e9fdf56..e6f245d3 100644
--- a/content/browser/plugin_process_host.cc
+++ b/content/browser/plugin_process_host.cc
@@ -29,7 +29,6 @@
#include "chrome/common/logging_chrome.h"
#include "chrome/common/net/url_request_context_getter.h"
#include "chrome/common/render_messages.h"
-#include "chrome/common/render_messages_params.h"
#include "content/browser/browser_thread.h"
#include "content/browser/plugin_service.h"
#include "content/browser/renderer_host/resource_dispatcher_host.h"
diff --git a/content/browser/renderer_host/render_view_host_delegate.cc b/content/browser/renderer_host/render_view_host_delegate.cc
index 72b12b7..2d56531 100644
--- a/content/browser/renderer_host/render_view_host_delegate.cc
+++ b/content/browser/renderer_host/render_view_host_delegate.cc
@@ -6,7 +6,6 @@
#include "base/memory/singleton.h"
#include "chrome/common/render_messages.h"
-#include "chrome/common/render_messages_params.h"
#include "content/common/renderer_preferences.h"
#include "googleurl/src/gurl.h"
#include "ui/gfx/rect.h"
diff --git a/content/browser/renderer_host/render_widget_helper.cc b/content/browser/renderer_host/render_widget_helper.cc
index 421af33..161bf88 100644
--- a/content/browser/renderer_host/render_widget_helper.cc
+++ b/content/browser/renderer_host/render_widget_helper.cc
@@ -6,7 +6,6 @@
#include "base/eintr_wrapper.h"
#include "base/threading/thread.h"
-#include "chrome/common/render_messages_params.h"
#include "content/browser/browser_thread.h"
#include "content/browser/renderer_host/render_process_host.h"
#include "content/browser/renderer_host/render_view_host.h"
diff --git a/content/browser/renderer_host/resource_dispatcher_host_unittest.cc b/content/browser/renderer_host/resource_dispatcher_host_unittest.cc
index 5354cfd..01e55e3 100644
--- a/content/browser/renderer_host/resource_dispatcher_host_unittest.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host_unittest.cc
@@ -8,7 +8,6 @@
#include "base/message_loop.h"
#include "base/process_util.h"
#include "chrome/common/render_messages.h"
-#include "chrome/common/render_messages_params.h"
#include "content/browser/browser_thread.h"
#include "content/browser/child_process_security_policy.h"
#include "content/browser/renderer_host/resource_dispatcher_host.h"
diff --git a/content/browser/tab_contents/navigation_controller_unittest.cc b/content/browser/tab_contents/navigation_controller_unittest.cc
index 9de7247..6a2ad65 100644
--- a/content/browser/tab_contents/navigation_controller_unittest.cc
+++ b/content/browser/tab_contents/navigation_controller_unittest.cc
@@ -14,7 +14,6 @@
#include "chrome/browser/sessions/session_service_test_helper.h"
#include "chrome/browser/sessions/session_types.h"
#include "chrome/common/render_messages.h"
-#include "chrome/common/render_messages_params.h"
#include "chrome/test/test_notification_tracker.h"
#include "chrome/test/testing_profile.h"
#include "content/browser/renderer_host/test_render_view_host.h"
diff --git a/content/renderer/pepper_plugin_delegate_impl.cc b/content/renderer/pepper_plugin_delegate_impl.cc
index 91efe42..28bf23e 100644
--- a/content/renderer/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper_plugin_delegate_impl.cc
@@ -16,7 +16,6 @@
#include "base/time.h"
#include "chrome/common/pepper_plugin_registry.h"
#include "chrome/common/render_messages.h"
-#include "chrome/common/render_messages_params.h"
#include "chrome/renderer/render_thread.h"
#include "content/common/audio_messages.h"
#include "content/common/child_process_messages.h"
diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc
index 07acef3..04fd392 100644
--- a/content/renderer/render_view.cc
+++ b/content/renderer/render_view.cc
@@ -1899,7 +1899,7 @@ bool RenderView::SendAndRunNestedMessageLoop(IPC::SyncMessage* message) {
void RenderView::AddGURLSearchProvider(
const GURL& osd_url,
- const ViewHostMsg_PageHasOSDD_Type& provider_type) {
+ search_provider::OSDDType provider_type) {
if (!osd_url.is_empty())
Send(new ViewHostMsg_PageHasOSDD(routing_id_, page_id_, osd_url,
provider_type));
@@ -1911,23 +1911,22 @@ void RenderView::OnAllowScriptToClose(bool script_can_close) {
void RenderView::AddSearchProvider(
const std::string& url,
- const ViewHostMsg_PageHasOSDD_Type& provider_type) {
- if (provider_type.type ==
- ViewHostMsg_PageHasOSDD_Type::EXPLICIT_DEFAULT_PROVIDER &&
+ search_provider::OSDDType provider_type) {
+ if (provider_type == search_provider::EXPLICIT_DEFAULT_PROVIDER &&
!webview()->mainFrame()->isProcessingUserGesture())
return;
AddGURLSearchProvider(GURL(url), provider_type);
}
-ViewHostMsg_GetSearchProviderInstallState_Params
+search_provider::InstallState
RenderView::GetSearchProviderInstallState(WebFrame* frame,
const std::string& url) {
GURL inquiry_url = GURL(url);
if (inquiry_url.is_empty())
- return ViewHostMsg_GetSearchProviderInstallState_Params::Denied();
+ return search_provider::DENIED;
- ViewHostMsg_GetSearchProviderInstallState_Params install;
+ search_provider::InstallState install;
Send(new ViewHostMsg_GetSearchProviderInstallState(routing_id_,
frame->url(),
inquiry_url,
@@ -2116,7 +2115,7 @@ void RenderView::didStopLoading() {
Send(new ViewHostMsg_UpdateFaviconURL(routing_id_, page_id_, favicon_url));
AddGURLSearchProvider(webview()->mainFrame()->openSearchDescriptionURL(),
- ViewHostMsg_PageHasOSDD_Type::Autodetected());
+ search_provider::AUTODETECTED_PROVIDER);
Send(new ViewHostMsg_DidStopLoading(routing_id_));
diff --git a/content/renderer/render_view.h b/content/renderer/render_view.h
index 05c64c2..0e4f6f6 100644
--- a/content/renderer/render_view.h
+++ b/content/renderer/render_view.h
@@ -22,6 +22,7 @@
#include "base/timer.h"
#include "build/build_config.h"
#include "chrome/common/content_settings.h"
+#include "chrome/common/search_provider.h"
#include "chrome/common/view_types.h"
#include "chrome/renderer/page_load_histograms.h"
#include "content/renderer/renderer_webcookiejar_impl.h"
@@ -82,8 +83,6 @@ struct ContextMenuMediaParams;
struct ExtensionMsg_ExecuteCode_Params;
struct PP_Flash_NetAddress;
struct ThumbnailScore;
-struct ViewHostMsg_GetSearchProviderInstallState_Params;
-struct ViewHostMsg_PageHasOSDD_Type;
struct ViewHostMsg_RunFileChooser_Params;
struct ViewMsg_ClosePage_Params;
struct ViewMsg_Navigate_Params;
@@ -263,12 +262,12 @@ class RenderView : public RenderWidget,
// Called from JavaScript window.external.AddSearchProvider() to add a
// keyword for a provider described in the given OpenSearch document.
void AddSearchProvider(const std::string& url,
- const ViewHostMsg_PageHasOSDD_Type& provider_type);
+ search_provider::OSDDType provider_type);
// Returns the install state for the given search provider url.
- ViewHostMsg_GetSearchProviderInstallState_Params
- GetSearchProviderInstallState(WebKit::WebFrame* frame,
- const std::string& url);
+ search_provider::InstallState GetSearchProviderInstallState(
+ WebKit::WebFrame* frame,
+ const std::string& url);
// Evaluates a string of JavaScript in a particular frame.
void EvaluateScript(const string16& frame_xpath,
@@ -772,7 +771,7 @@ class RenderView : public RenderWidget,
// Adds search provider from the given OpenSearch description URL as a
// keyword search.
void AddGURLSearchProvider(const GURL& osd_url,
- const ViewHostMsg_PageHasOSDD_Type& provider_type);
+ search_provider::OSDDType provider_type);
// Send queued accessibility notifications from the renderer to the browser.
void SendPendingAccessibilityNotifications();
diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc
index 6c7b1fc..ae23dc4 100644
--- a/content/renderer/render_view_browsertest.cc
+++ b/content/renderer/render_view_browsertest.cc
@@ -11,7 +11,6 @@
#include "chrome/common/autofill_messages.h"
#include "chrome/common/content_settings.h"
#include "chrome/common/render_messages.h"
-#include "chrome/common/render_messages_params.h"
#include "chrome/renderer/autofill/autofill_agent.h"
#include "chrome/renderer/print_web_view_helper.h"
#include "chrome/test/render_view_test.h"
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 79da43d4..3f3fc75 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -12,7 +12,6 @@
#include "build/build_config.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/render_messages.h"
-#include "chrome/common/render_messages_params.h"
#include "chrome/renderer/render_process.h"
#include "chrome/renderer/render_thread.h"
#include "content/common/view_messages.h"