summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-19 18:03:30 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-19 18:03:30 +0000
commite7c21b81e038b600c4a39a8c0f9e92ed6a6612c6 (patch)
tree6f0bcf6afa6862b279b1fc1d23d78cead2bd0de3 /content
parent903226b51dbba87492e2dac5405f82f5b3947f6d (diff)
downloadchromium_src-e7c21b81e038b600c4a39a8c0f9e92ed6a6612c6.zip
chromium_src-e7c21b81e038b600c4a39a8c0f9e92ed6a6612c6.tar.gz
chromium_src-e7c21b81e038b600c4a39a8c0f9e92ed6a6612c6.tar.bz2
Move geolocation, desktop notification, and device orientation into their own message files.Also fix a regression from my earlier change to create a plugin through the embedder API. The fix is to not to create a plugin if the embedder returns NULL, and just have the default implementation create the plugin on its own.TBR=avi
R=brettw@chromium.org,johnnyg@chromium.org,darin@chromium.org,*,jam@chromium.org,ben@chromium.org Review URL: http://codereview.chromium.org/6688054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78832 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/device_orientation/message_filter.cc13
-rw-r--r--content/browser/geolocation/geolocation_dispatcher_host.cc14
-rw-r--r--content/browser/geolocation/geolocation_permission_context.h6
-rw-r--r--content/browser/renderer_host/render_message_filter.cc3
-rw-r--r--content/common/common_param_traits.h6
-rw-r--r--content/common/content_message_generator.h3
-rw-r--r--content/common/desktop_notification_messages.h80
-rw-r--r--content/common/device_orientation_messages.h36
-rw-r--r--content/common/geolocation_messages.h72
-rw-r--r--content/content_common.gypi3
-rw-r--r--content/renderer/content_renderer_client.cc4
-rw-r--r--content/renderer/device_orientation_dispatcher.cc14
-rw-r--r--content/renderer/device_orientation_dispatcher.h8
-rw-r--r--content/renderer/geolocation_dispatcher.cc23
-rw-r--r--content/renderer/geolocation_dispatcher.h4
-rw-r--r--content/renderer/notification_provider.cc31
-rw-r--r--content/renderer/render_view.cc5
17 files changed, 258 insertions, 67 deletions
diff --git a/content/browser/device_orientation/message_filter.cc b/content/browser/device_orientation/message_filter.cc
index 4cb7501..283fb31 100644
--- a/content/browser/device_orientation/message_filter.cc
+++ b/content/browser/device_orientation/message_filter.cc
@@ -5,13 +5,12 @@
#include "content/browser/device_orientation/message_filter.h"
#include "base/scoped_ptr.h"
-#include "chrome/common/render_messages.h"
-#include "chrome/common/render_messages_params.h"
#include "content/browser/browser_thread.h"
#include "content/browser/device_orientation/orientation.h"
#include "content/browser/device_orientation/provider.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/renderer_host/render_view_host_notification_task.h"
+#include "content/common/device_orientation_messages.h"
namespace device_orientation {
@@ -60,7 +59,7 @@ MessageFilter::ObserverDelegate::~ObserverDelegate() {
void MessageFilter::ObserverDelegate::OnOrientationUpdate(
const Orientation& orientation) {
- ViewMsg_DeviceOrientationUpdated_Params params;
+ DeviceOrientationMsg_Updated_Params params;
params.can_provide_alpha = orientation.can_provide_alpha_;
params.alpha = orientation.alpha_;
params.can_provide_beta = orientation.can_provide_beta_;
@@ -68,7 +67,7 @@ void MessageFilter::ObserverDelegate::OnOrientationUpdate(
params.can_provide_gamma = orientation.can_provide_gamma_;
params.gamma = orientation.gamma_;
- sender_->Send(new ViewMsg_DeviceOrientationUpdated(render_view_id_, params));
+ sender_->Send(new DeviceOrientationMsg_Updated(render_view_id_, params));
}
bool MessageFilter::OnMessageReceived(const IPC::Message& message,
@@ -76,10 +75,8 @@ bool MessageFilter::OnMessageReceived(const IPC::Message& message,
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
bool handled = true;
IPC_BEGIN_MESSAGE_MAP_EX(MessageFilter, message, *message_was_ok)
- IPC_MESSAGE_HANDLER(ViewHostMsg_DeviceOrientation_StartUpdating,
- OnStartUpdating)
- IPC_MESSAGE_HANDLER(ViewHostMsg_DeviceOrientation_StopUpdating,
- OnStopUpdating)
+ IPC_MESSAGE_HANDLER(DeviceOrientationHostMsg_StartUpdating, OnStartUpdating)
+ IPC_MESSAGE_HANDLER(DeviceOrientationHostMsg_StopUpdating, OnStopUpdating)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
diff --git a/content/browser/geolocation/geolocation_dispatcher_host.cc b/content/browser/geolocation/geolocation_dispatcher_host.cc
index 33193d3..4f28934 100644
--- a/content/browser/geolocation/geolocation_dispatcher_host.cc
+++ b/content/browser/geolocation/geolocation_dispatcher_host.cc
@@ -8,12 +8,12 @@
#include <set>
#include <utility>
-#include "chrome/common/render_messages.h"
#include "content/browser/geolocation/geolocation_permission_context.h"
#include "content/browser/geolocation/geolocation_provider.h"
#include "content/browser/renderer_host/render_message_filter.h"
#include "content/browser/renderer_host/render_process_host.h"
#include "content/browser/renderer_host/render_view_host.h"
+#include "content/common/geolocation_messages.h"
#include "content/common/geoposition.h"
namespace {
@@ -85,14 +85,12 @@ bool GeolocationDispatcherHostImpl::OnMessageReceived(
*msg_was_ok = true;
bool handled = true;
IPC_BEGIN_MESSAGE_MAP_EX(GeolocationDispatcherHostImpl, msg, *msg_was_ok)
- IPC_MESSAGE_HANDLER(ViewHostMsg_Geolocation_CancelPermissionRequest,
+ IPC_MESSAGE_HANDLER(GeolocationHostMsg_CancelPermissionRequest,
OnCancelPermissionRequest)
- IPC_MESSAGE_HANDLER(ViewHostMsg_Geolocation_RequestPermission,
+ IPC_MESSAGE_HANDLER(GeolocationHostMsg_RequestPermission,
OnRequestPermission)
- IPC_MESSAGE_HANDLER(ViewHostMsg_Geolocation_StartUpdating,
- OnStartUpdating)
- IPC_MESSAGE_HANDLER(ViewHostMsg_Geolocation_StopUpdating,
- OnStopUpdating)
+ IPC_MESSAGE_HANDLER(GeolocationHostMsg_StartUpdating, OnStartUpdating)
+ IPC_MESSAGE_HANDLER(GeolocationHostMsg_StopUpdating, OnStopUpdating)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -103,7 +101,7 @@ void GeolocationDispatcherHostImpl::OnLocationUpdate(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
for (std::set<int>::iterator it = geolocation_renderer_ids_.begin();
it != geolocation_renderer_ids_.end(); ++it) {
- Send(new ViewMsg_Geolocation_PositionUpdated(*it, geoposition));
+ Send(new GeolocationMsg_PositionUpdated(*it, geoposition));
}
}
diff --git a/content/browser/geolocation/geolocation_permission_context.h b/content/browser/geolocation/geolocation_permission_context.h
index ed86c70..2507a69 100644
--- a/content/browser/geolocation/geolocation_permission_context.h
+++ b/content/browser/geolocation/geolocation_permission_context.h
@@ -21,14 +21,14 @@ class TabContents;
// GeolocationPermissionContext manages Geolocation permissions flow,
// and delegates UI handling via GeolocationInfoBarQueueController.
// It always notifies the requesting render_view asynchronously via
-// ViewMsg_Geolocation_PermissionSet.
+// GeolocationMsg_PermissionSet.
class GeolocationPermissionContext
: public base::RefCountedThreadSafe<GeolocationPermissionContext> {
public:
explicit GeolocationPermissionContext(Profile* profile);
// The render is requesting permission to use Geolocation.
- // Response will be sent asynchronously as ViewMsg_Geolocation_PermissionSet.
+ // Response will be sent asynchronously as GeolocationMsg_PermissionSet.
void RequestGeolocationPermission(
int render_process_id, int render_view_id, int bridge_id,
const GURL& requesting_frame);
@@ -39,7 +39,7 @@ class GeolocationPermissionContext
const GURL& requesting_frame);
// Notifies whether or not the corresponding bridge is allowed to use
- // geolocation via ViewMsg_Geolocation_PermissionSet.
+ // geolocation via GeolocationMsg_PermissionSet.
void NotifyPermissionSet(
int render_process_id, int render_view_id, int bridge_id,
const GURL& requesting_frame, bool allowed);
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc
index 7683d4f..05cbb2b 100644
--- a/content/browser/renderer_host/render_message_filter.cc
+++ b/content/browser/renderer_host/render_message_filter.cc
@@ -45,6 +45,7 @@
#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/browser/renderer_host/render_view_host_notification_task.h"
#include "content/browser/renderer_host/render_widget_helper.h"
+#include "content/common/desktop_notification_messages.h"
#include "content/common/notification_service.h"
#include "ipc/ipc_channel_handle.h"
#include "net/base/cookie_monster.h"
@@ -364,7 +365,7 @@ bool RenderMessageFilter::OnMessageReceived(const IPC::Message& message,
IPC_MESSAGE_HANDLER(ViewHostMsg_RendererHistograms, OnRendererHistograms)
IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_UpdateRect,
render_widget_helper_->DidReceiveUpdateMsg(message))
- IPC_MESSAGE_HANDLER(ViewHostMsg_CheckNotificationPermission,
+ IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_CheckPermission,
OnCheckNotificationPermission)
IPC_MESSAGE_HANDLER(ViewHostMsg_RevealFolderInOS, OnRevealFolderInOS)
IPC_MESSAGE_HANDLER(ViewHostMsg_AllocateSharedMemoryBuffer,
diff --git a/content/common/common_param_traits.h b/content/common/common_param_traits.h
index 6559440..3f7d0b3 100644
--- a/content/common/common_param_traits.h
+++ b/content/common/common_param_traits.h
@@ -23,6 +23,7 @@
#include "net/base/ip_endpoint.h"
#include "net/url_request/url_request_status.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h"
#include "ui/gfx/native_widget_types.h"
#include "webkit/blob/blob_data.h"
#include "webkit/glue/npruntime_util.h"
@@ -378,6 +379,11 @@ struct ParamTraits<TransportDIB::Id> {
};
#endif
+template <>
+struct SimilarTypeTraits<WebKit::WebTextDirection> {
+ typedef int Type;
+};
+
} // namespace IPC
#endif // CONTENT_COMMON_COMMON_PARAM_TRAITS_H_
diff --git a/content/common/content_message_generator.h b/content/common/content_message_generator.h
index d6ac72f36..f244c90 100644
--- a/content/common/content_message_generator.h
+++ b/content/common/content_message_generator.h
@@ -8,9 +8,12 @@
#include "content/common/child_process_messages.h"
#include "content/common/clipboard_messages.h"
#include "content/common/database_messages.h"
+#include "content/common/desktop_notification_messages.h"
+#include "content/common/device_orientation_messages.h"
#include "content/common/dom_storage_messages.h"
#include "content/common/file_system_messages.h"
#include "content/common/file_utilities_messages.h"
+#include "content/common/geolocation_messages.h"
#include "content/common/gpu_messages.h"
#include "content/common/indexed_db_messages.h"
#include "content/common/mime_registry_messages.h"
diff --git a/content/common/desktop_notification_messages.h b/content/common/desktop_notification_messages.h
new file mode 100644
index 0000000..c8642e9
--- /dev/null
+++ b/content/common/desktop_notification_messages.h
@@ -0,0 +1,80 @@
+// 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.
+
+// IPC messages for desktop notification.
+// Multiply-included message file, hence no include guard.
+
+#include "ipc/ipc_message_macros.h"
+#include "googleurl/src/gurl.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h"
+
+#define IPC_MESSAGE_START DesktopNotificationMsgStart
+
+IPC_STRUCT_BEGIN(DesktopNotificationHostMsg_Show_Params)
+ // URL which is the origin that created this notification.
+ IPC_STRUCT_MEMBER(GURL, origin)
+
+ // True if this is HTML
+ IPC_STRUCT_MEMBER(bool, is_html)
+
+ // URL which contains the HTML contents (if is_html is true), otherwise empty.
+ IPC_STRUCT_MEMBER(GURL, contents_url)
+
+ // Contents of the notification if is_html is false.
+ IPC_STRUCT_MEMBER(GURL, icon_url)
+ IPC_STRUCT_MEMBER(string16, title)
+ IPC_STRUCT_MEMBER(string16, body)
+
+ // Directionality of the notification.
+ IPC_STRUCT_MEMBER(WebKit::WebTextDirection, direction)
+
+ // ReplaceID if this notification should replace an existing one) may be
+ // empty if no replacement is called for.
+ IPC_STRUCT_MEMBER(string16, replace_id)
+
+ // Notification ID for sending events back for this notification.
+ IPC_STRUCT_MEMBER(int, notification_id)
+IPC_STRUCT_END()
+
+// Messages sent from the browser to the renderer.
+
+// Used to inform the renderer that the browser has displayed its
+// requested notification.
+IPC_MESSAGE_ROUTED1(DesktopNotificationMsg_PostDisplay,
+ int /* notification_id */)
+
+// Used to inform the renderer that the browser has encountered an error
+// trying to display a notification.
+IPC_MESSAGE_ROUTED2(DesktopNotificationMsg_PostError,
+ int /* notification_id */,
+ string16 /* message */)
+
+// Informs the renderer that the one if its notifications has closed.
+IPC_MESSAGE_ROUTED2(DesktopNotificationMsg_PostClose,
+ int /* notification_id */,
+ bool /* by_user */)
+
+// Informs the renderer that one of its notifications was clicked on.
+IPC_MESSAGE_ROUTED1(DesktopNotificationMsg_PostClick,
+ int /* notification_id */)
+
+// Informs the renderer that the one if its notifications has closed.
+IPC_MESSAGE_ROUTED1(DesktopNotificationMsg_PermissionRequestDone,
+ int /* request_id */)
+
+// Messages sent from the renderer to the browser.
+
+IPC_MESSAGE_ROUTED1(DesktopNotificationHostMsg_Show,
+ DesktopNotificationHostMsg_Show_Params)
+
+IPC_MESSAGE_ROUTED1(DesktopNotificationHostMsg_Cancel,
+ int /* notification_id */)
+
+IPC_MESSAGE_ROUTED2(DesktopNotificationHostMsg_RequestPermission,
+ GURL /* origin */,
+ int /* callback_context */)
+
+IPC_SYNC_MESSAGE_ROUTED1_1(DesktopNotificationHostMsg_CheckPermission,
+ GURL /* source page */,
+ int /* permission_result */)
diff --git a/content/common/device_orientation_messages.h b/content/common/device_orientation_messages.h
new file mode 100644
index 0000000..acd9122
--- /dev/null
+++ b/content/common/device_orientation_messages.h
@@ -0,0 +1,36 @@
+// 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.
+
+// IPC messages for device orientation.
+// Multiply-included message file, hence no include guard.
+
+#include "ipc/ipc_message_macros.h"
+
+#define IPC_MESSAGE_START DeviceOrientationMsgStart
+
+IPC_STRUCT_BEGIN(DeviceOrientationMsg_Updated_Params)
+ // These fields have the same meaning as in device_orientation::Orientation.
+ IPC_STRUCT_MEMBER(bool, can_provide_alpha)
+ IPC_STRUCT_MEMBER(double, alpha)
+ IPC_STRUCT_MEMBER(bool, can_provide_beta)
+ IPC_STRUCT_MEMBER(double, beta)
+ IPC_STRUCT_MEMBER(bool, can_provide_gamma)
+ IPC_STRUCT_MEMBER(double, gamma)
+IPC_STRUCT_END()
+
+// Messages sent from the browser to the renderer.
+
+// Notification that the device's orientation has changed.
+IPC_MESSAGE_ROUTED1(DeviceOrientationMsg_Updated,
+ DeviceOrientationMsg_Updated_Params)
+
+// Messages sent from the renderer to the browser.
+
+// A RenderView requests to start receiving device orientation updates.
+IPC_MESSAGE_CONTROL1(DeviceOrientationHostMsg_StartUpdating,
+ int /* render_view_id */)
+
+// A RenderView requests to stop receiving device orientation updates.
+IPC_MESSAGE_CONTROL1(DeviceOrientationHostMsg_StopUpdating,
+ int /* render_view_id */)
diff --git a/content/common/geolocation_messages.h b/content/common/geolocation_messages.h
new file mode 100644
index 0000000..b945de5
--- /dev/null
+++ b/content/common/geolocation_messages.h
@@ -0,0 +1,72 @@
+// 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.
+
+// IPC messages for geolocation.
+// Multiply-included message file, hence no include guard.
+
+#include "content/common/geoposition.h"
+#include "googleurl/src/gurl.h"
+#include "ipc/ipc_message_macros.h"
+
+#define IPC_MESSAGE_START GeolocationMsgStart
+
+IPC_ENUM_TRAITS(Geoposition::ErrorCode)
+
+IPC_STRUCT_TRAITS_BEGIN(Geoposition)
+ IPC_STRUCT_TRAITS_MEMBER(latitude)
+ IPC_STRUCT_TRAITS_MEMBER(longitude)
+ IPC_STRUCT_TRAITS_MEMBER(altitude)
+ IPC_STRUCT_TRAITS_MEMBER(accuracy)
+ IPC_STRUCT_TRAITS_MEMBER(altitude_accuracy)
+ IPC_STRUCT_TRAITS_MEMBER(heading)
+ IPC_STRUCT_TRAITS_MEMBER(speed)
+ IPC_STRUCT_TRAITS_MEMBER(timestamp)
+ IPC_STRUCT_TRAITS_MEMBER(error_code)
+ IPC_STRUCT_TRAITS_MEMBER(error_message)
+IPC_STRUCT_TRAITS_END()
+
+// Messages sent from the browser to the renderer.
+
+// Reply in response to GeolocationHostMsg_RequestPermission.
+IPC_MESSAGE_ROUTED2(GeolocationMsg_PermissionSet,
+ int /* bridge_id */,
+ bool /* is_allowed */)
+
+// Sent after GeolocationHostMsg_StartUpdating iff the user has granted
+// permission and we have a position available or an error occurs (such as
+// permission denied, position unavailable, etc.)
+IPC_MESSAGE_ROUTED1(GeolocationMsg_PositionUpdated,
+ Geoposition /* geoposition */)
+
+// Messages sent from the renderer to the browser.
+
+// The |render_view_id| and |bridge_id| representing |host| is requesting
+// permission to access geolocation position.
+// This will be replied by GeolocationMsg_PermissionSet.
+IPC_MESSAGE_CONTROL3(GeolocationHostMsg_RequestPermission,
+ int /* render_view_id */,
+ int /* bridge_id */,
+ GURL /* GURL of the frame requesting geolocation */)
+
+// The |render_view_id| and |bridge_id| representing |GURL| is cancelling its
+// previous permission request to access geolocation position.
+IPC_MESSAGE_CONTROL3(GeolocationHostMsg_CancelPermissionRequest,
+ int /* render_view_id */,
+ int /* bridge_id */,
+ GURL /* GURL of the frame */)
+
+// The |render_view_id| requests Geolocation service to start updating.
+// This is an asynchronous call, and the browser process may eventually reply
+// with the updated geoposition, or an error (access denied, location
+// unavailable, etc.)
+IPC_MESSAGE_CONTROL3(GeolocationHostMsg_StartUpdating,
+ int /* render_view_id */,
+ GURL /* GURL of the frame requesting geolocation */,
+ bool /* enable_high_accuracy */)
+
+// The |render_view_id| requests Geolocation service to stop updating.
+// Note that the geolocation service may continue to fetch geolocation data
+// for other origins.
+IPC_MESSAGE_CONTROL1(GeolocationHostMsg_StopUpdating,
+ int /* render_view_id */)
diff --git a/content/content_common.gypi b/content/content_common.gypi
index 45ea981..89dcf5f 100644
--- a/content/content_common.gypi
+++ b/content/content_common.gypi
@@ -60,6 +60,8 @@
'common/db_message_filter.h',
'common/debug_flags.cc',
'common/debug_flags.h',
+ 'common/desktop_notification_messages.h',
+ 'common/device_orientation_messages.h',
'common/dom_storage_common.h',
'common/dom_storage_messages.h',
'common/dx_diag_node.cc',
@@ -87,6 +89,7 @@
'common/font_loader_mac.mm',
'common/gpu_feature_flags.cc',
'common/gpu_feature_flags.h',
+ 'common/geolocation_messages.h',
'common/geoposition.cc',
'common/geoposition.h',
'common/gpu_info.cc',
diff --git a/content/renderer/content_renderer_client.cc b/content/renderer/content_renderer_client.cc
index b06acad..96a53f6 100644
--- a/content/renderer/content_renderer_client.cc
+++ b/content/renderer/content_renderer_client.cc
@@ -4,6 +4,8 @@
#include "content/renderer/content_renderer_client.h"
+#include "content/renderer/render_view.h"
+
namespace content {
SkBitmap* ContentRendererClient::GetSadPluginBitmap() {
@@ -18,7 +20,7 @@ WebKit::WebPlugin* ContentRendererClient::CreatePlugin(
RenderView* render_view,
WebKit::WebFrame* frame,
const WebKit::WebPluginParams& params) {
- return NULL;
+ return render_view->CreatePluginNoCheck(frame, params);
}
std::string ContentRendererClient::GetNavigationErrorHtml(
diff --git a/content/renderer/device_orientation_dispatcher.cc b/content/renderer/device_orientation_dispatcher.cc
index 309a3e8..0ffe827 100644
--- a/content/renderer/device_orientation_dispatcher.cc
+++ b/content/renderer/device_orientation_dispatcher.cc
@@ -4,8 +4,7 @@
#include "content/renderer/device_orientation_dispatcher.h"
-#include "chrome/common/render_messages.h"
-#include "chrome/common/render_messages_params.h"
+#include "content/common/device_orientation_messages.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDeviceOrientation.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDeviceOrientationController.h"
@@ -24,7 +23,7 @@ DeviceOrientationDispatcher::~DeviceOrientationDispatcher() {
bool DeviceOrientationDispatcher::OnMessageReceived(const IPC::Message& msg) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(DeviceOrientationDispatcher, msg)
- IPC_MESSAGE_HANDLER(ViewMsg_DeviceOrientationUpdated,
+ IPC_MESSAGE_HANDLER(DeviceOrientationMsg_Updated,
OnDeviceOrientationUpdated)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -37,12 +36,12 @@ void DeviceOrientationDispatcher::setController(
}
void DeviceOrientationDispatcher::startUpdating() {
- Send(new ViewHostMsg_DeviceOrientation_StartUpdating(routing_id()));
+ Send(new DeviceOrientationHostMsg_StartUpdating(routing_id()));
started_ = true;
}
void DeviceOrientationDispatcher::stopUpdating() {
- Send(new ViewHostMsg_DeviceOrientation_StopUpdating(routing_id()));
+ Send(new DeviceOrientationHostMsg_StopUpdating(routing_id()));
started_ = false;
}
@@ -55,7 +54,7 @@ WebKit::WebDeviceOrientation DeviceOrientationDispatcher::lastOrientation()
}
namespace {
-bool OrientationsEqual(const ViewMsg_DeviceOrientationUpdated_Params& a,
+bool OrientationsEqual(const DeviceOrientationMsg_Updated_Params& a,
WebKit::WebDeviceOrientation* b) {
if (a.can_provide_alpha != b->canProvideAlpha())
return false;
@@ -75,8 +74,7 @@ bool OrientationsEqual(const ViewMsg_DeviceOrientationUpdated_Params& a,
} // namespace
void DeviceOrientationDispatcher::OnDeviceOrientationUpdated(
- const ViewMsg_DeviceOrientationUpdated_Params& p) {
-
+ const DeviceOrientationMsg_Updated_Params& p) {
if (last_orientation_.get() && OrientationsEqual(p, last_orientation_.get()))
return;
diff --git a/content/renderer/device_orientation_dispatcher.h b/content/renderer/device_orientation_dispatcher.h
index 9421b41..44b4b62 100644
--- a/content/renderer/device_orientation_dispatcher.h
+++ b/content/renderer/device_orientation_dispatcher.h
@@ -10,9 +10,11 @@
#include "base/scoped_ptr.h"
#include "content/renderer/render_view_observer.h"
-namespace WebKit { class WebDeviceOrientation; }
+namespace WebKit {
+class WebDeviceOrientation;
+}
-struct ViewMsg_DeviceOrientationUpdated_Params;
+struct DeviceOrientationMsg_Updated_Params;
class DeviceOrientationDispatcher : public RenderViewObserver,
public WebKit::WebDeviceOrientationClient {
@@ -32,7 +34,7 @@ class DeviceOrientationDispatcher : public RenderViewObserver,
virtual WebKit::WebDeviceOrientation lastOrientation() const;
void OnDeviceOrientationUpdated(
- const ViewMsg_DeviceOrientationUpdated_Params& p);
+ const DeviceOrientationMsg_Updated_Params& p);
scoped_ptr<WebKit::WebDeviceOrientationController> controller_;
scoped_ptr<WebKit::WebDeviceOrientation> last_orientation_;
diff --git a/content/renderer/geolocation_dispatcher.cc b/content/renderer/geolocation_dispatcher.cc
index 0934aad..bcacbab 100644
--- a/content/renderer/geolocation_dispatcher.cc
+++ b/content/renderer/geolocation_dispatcher.cc
@@ -4,13 +4,14 @@
#include "content/renderer/geolocation_dispatcher.h"
-#include "chrome/common/render_messages.h"
+#include "content/common/geolocation_messages.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebGeolocationPermissionRequest.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebGeolocationPermissionRequestManager.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebGeolocationClient.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebGeolocationPosition.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebGeolocationError.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
using namespace WebKit;
@@ -26,10 +27,8 @@ GeolocationDispatcher::~GeolocationDispatcher() {}
bool GeolocationDispatcher::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(GeolocationDispatcher, message)
- IPC_MESSAGE_HANDLER(ViewMsg_Geolocation_PermissionSet,
- OnGeolocationPermissionSet)
- IPC_MESSAGE_HANDLER(ViewMsg_Geolocation_PositionUpdated,
- OnGeolocationPositionUpdated)
+ IPC_MESSAGE_HANDLER(GeolocationMsg_PermissionSet, OnPermissionSet)
+ IPC_MESSAGE_HANDLER(GeolocationMsg_PositionUpdated, OnPositionUpdated)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -42,13 +41,13 @@ void GeolocationDispatcher::geolocationDestroyed() {
void GeolocationDispatcher::startUpdating() {
GURL url;
- Send(new ViewHostMsg_Geolocation_StartUpdating(
+ Send(new GeolocationHostMsg_StartUpdating(
routing_id(), url, enable_high_accuracy_));
updating_ = true;
}
void GeolocationDispatcher::stopUpdating() {
- Send(new ViewHostMsg_Geolocation_StopUpdating(routing_id()));
+ Send(new GeolocationHostMsg_StopUpdating(routing_id()));
updating_ = false;
}
@@ -83,7 +82,7 @@ void GeolocationDispatcher::requestPermission(
const WebGeolocationPermissionRequest& permissionRequest) {
int bridge_id = pending_permissions_->add(permissionRequest);
string16 origin = permissionRequest.securityOrigin().toString();
- Send(new ViewHostMsg_Geolocation_RequestPermission(
+ Send(new GeolocationHostMsg_RequestPermission(
routing_id(), bridge_id, GURL(origin)));
}
@@ -95,13 +94,12 @@ void GeolocationDispatcher::cancelPermissionRequest(
if (!pending_permissions_->remove(permissionRequest, bridge_id))
return;
string16 origin = permissionRequest.securityOrigin().toString();
- Send(new ViewHostMsg_Geolocation_CancelPermissionRequest(
+ Send(new GeolocationHostMsg_CancelPermissionRequest(
routing_id(), bridge_id, GURL(origin)));
}
// Permission for using geolocation has been set.
-void GeolocationDispatcher::OnGeolocationPermissionSet(
- int bridge_id, bool is_allowed) {
+void GeolocationDispatcher::OnPermissionSet(int bridge_id, bool is_allowed) {
WebGeolocationPermissionRequest permissionRequest;
if (!pending_permissions_->remove(bridge_id, permissionRequest))
return;
@@ -109,8 +107,7 @@ void GeolocationDispatcher::OnGeolocationPermissionSet(
}
// We have an updated geolocation position or error code.
-void GeolocationDispatcher::OnGeolocationPositionUpdated(
- const Geoposition& geoposition) {
+void GeolocationDispatcher::OnPositionUpdated(const Geoposition& geoposition) {
// It is possible for the browser process to have queued an update message
// before receiving the stop updating message.
if (!updating_)
diff --git a/content/renderer/geolocation_dispatcher.h b/content/renderer/geolocation_dispatcher.h
index 3f70853..27731f6 100644
--- a/content/renderer/geolocation_dispatcher.h
+++ b/content/renderer/geolocation_dispatcher.h
@@ -47,10 +47,10 @@ class GeolocationDispatcher : public RenderViewObserver,
const WebKit::WebGeolocationPermissionRequest& permissionRequest);
// Permission for using geolocation has been set.
- void OnGeolocationPermissionSet(int bridge_id, bool is_allowed);
+ void OnPermissionSet(int bridge_id, bool is_allowed);
// We have an updated geolocation position or error code.
- void OnGeolocationPositionUpdated(const Geoposition& geoposition);
+ void OnPositionUpdated(const Geoposition& geoposition);
// The controller_ is valid for the lifetime of the underlying
// WebCore::GeolocationController. geolocationDestroyed() is
diff --git a/content/renderer/notification_provider.cc b/content/renderer/notification_provider.cc
index 816f4ca..5beb8e1 100644
--- a/content/renderer/notification_provider.cc
+++ b/content/renderer/notification_provider.cc
@@ -6,10 +6,10 @@
#include "base/string_util.h"
#include "base/task.h"
-#include "chrome/common/render_messages.h"
-#include "chrome/common/render_messages_params.h"
#include "chrome/common/url_constants.h"
+#include "chrome/common/render_messages.h"
#include "chrome/renderer/render_thread.h"
+#include "content/common/desktop_notification_messages.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"
@@ -46,7 +46,7 @@ void NotificationProvider::cancel(const WebNotification& notification) {
bool id_found = manager_.GetId(notification, id);
// Won't be found if the notification has already been closed by the user.
if (id_found)
- Send(new ViewHostMsg_CancelDesktopNotification(routing_id(), id));
+ Send(new DesktopNotificationHostMsg_Cancel(routing_id(), id));
}
void NotificationProvider::objectDestroyed(
@@ -61,7 +61,7 @@ void NotificationProvider::objectDestroyed(
WebNotificationPresenter::Permission NotificationProvider::checkPermission(
const WebURL& url) {
int permission;
- Send(new ViewHostMsg_CheckNotificationPermission(
+ Send(new DesktopNotificationHostMsg_CheckPermission(
routing_id(),
url,
&permission));
@@ -77,19 +77,18 @@ void NotificationProvider::requestPermission(
int id = manager_.RegisterPermissionRequest(callback);
- Send(new ViewHostMsg_RequestNotificationPermission(routing_id(),
- GURL(origin.toString()),
- id));
+ Send(new DesktopNotificationHostMsg_RequestPermission(
+ routing_id(), GURL(origin.toString()), id));
}
bool NotificationProvider::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(NotificationProvider, message)
- IPC_MESSAGE_HANDLER(ViewMsg_PostDisplayToNotificationObject, OnDisplay);
- IPC_MESSAGE_HANDLER(ViewMsg_PostErrorToNotificationObject, OnError);
- IPC_MESSAGE_HANDLER(ViewMsg_PostCloseToNotificationObject, OnClose);
- IPC_MESSAGE_HANDLER(ViewMsg_PostClickToNotificationObject, OnClick);
- IPC_MESSAGE_HANDLER(ViewMsg_PermissionRequestDone,
+ IPC_MESSAGE_HANDLER(DesktopNotificationMsg_PostDisplay, OnDisplay);
+ IPC_MESSAGE_HANDLER(DesktopNotificationMsg_PostError, OnError);
+ IPC_MESSAGE_HANDLER(DesktopNotificationMsg_PostClose, OnClose);
+ IPC_MESSAGE_HANDLER(DesktopNotificationMsg_PostClick, OnClick);
+ IPC_MESSAGE_HANDLER(DesktopNotificationMsg_PermissionRequestDone,
OnPermissionRequestComplete);
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -112,20 +111,20 @@ bool NotificationProvider::ShowHTML(const WebNotification& notification,
return false;
DCHECK(notification.isHTML());
- ViewHostMsg_ShowNotification_Params params;
+ DesktopNotificationHostMsg_Show_Params params;
params.origin =
GURL(render_view()->webview()->mainFrame()->url()).GetOrigin();
params.is_html = true;
params.contents_url = notification.url();
params.notification_id = id;
params.replace_id = notification.replaceId();
- return Send(new ViewHostMsg_ShowDesktopNotification(routing_id(), params));
+ return Send(new DesktopNotificationHostMsg_Show(routing_id(), params));
}
bool NotificationProvider::ShowText(const WebNotification& notification,
int id) {
DCHECK(!notification.isHTML());
- ViewHostMsg_ShowNotification_Params params;
+ DesktopNotificationHostMsg_Show_Params params;
params.is_html = false;
params.origin = GURL(
render_view()->webview()->mainFrame()->url()).GetOrigin();
@@ -135,7 +134,7 @@ bool NotificationProvider::ShowText(const WebNotification& notification,
params.direction = notification.direction();
params.notification_id = id;
params.replace_id = notification.replaceId();
- return Send(new ViewHostMsg_ShowDesktopNotification(routing_id(), params));
+ return Send(new DesktopNotificationHostMsg_Show(routing_id(), params));
}
void NotificationProvider::OnDisplay(int id) {
diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc
index 612693b..73b97d9 100644
--- a/content/renderer/render_view.cc
+++ b/content/renderer/render_view.cc
@@ -2629,11 +2629,8 @@ void RenderView::runModal() {
WebPlugin* RenderView::createPlugin(WebFrame* frame,
const WebPluginParams& params) {
- WebPlugin* plugin = content::GetContentClient()->renderer()->CreatePlugin(
+ return content::GetContentClient()->renderer()->CreatePlugin(
this, frame, params);
- if (!plugin)
- plugin = CreatePluginNoCheck(frame, params);
- return plugin;
}
WebWorker* RenderView::createWorker(WebFrame* frame, WebWorkerClient* client) {