diff options
Diffstat (limited to 'components/guest_view/common')
-rw-r--r-- | components/guest_view/common/DEPS | 3 | ||||
-rw-r--r-- | components/guest_view/common/OWNERS | 15 | ||||
-rw-r--r-- | components/guest_view/common/guest_view_constants.cc | 45 | ||||
-rw-r--r-- | components/guest_view/common/guest_view_constants.h | 50 | ||||
-rw-r--r-- | components/guest_view/common/guest_view_message_generator.cc | 33 | ||||
-rw-r--r-- | components/guest_view/common/guest_view_message_generator.h | 7 | ||||
-rw-r--r-- | components/guest_view/common/guest_view_messages.h | 35 |
7 files changed, 188 insertions, 0 deletions
diff --git a/components/guest_view/common/DEPS b/components/guest_view/common/DEPS new file mode 100644 index 0000000..b0e64bf --- /dev/null +++ b/components/guest_view/common/DEPS @@ -0,0 +1,3 @@ +include_rules = [ + "+ipc" +] diff --git a/components/guest_view/common/OWNERS b/components/guest_view/common/OWNERS new file mode 100644 index 0000000..bba0da4 --- /dev/null +++ b/components/guest_view/common/OWNERS @@ -0,0 +1,15 @@ +fsamuel@chromium.org +lazyboy@chromium.org + +# For security review of IPC message files. +per-file *_messages*.h=set noparent +per-file *_messages*.h=dcheng@chromium.org +per-file *_messages*.h=inferno@chromium.org +per-file *_messages*.h=jln@chromium.org +per-file *_messages*.h=jschuh@chromium.org +per-file *_messages*.h=kenrb@chromium.org +per-file *_messages*.h=mkwst@chromium.org +per-file *_messages*.h=nasko@chromium.org +per-file *_messages*.h=palmer@chromium.org +per-file *_messages*.h=tsepez@chromium.org +per-file *_messages*.h=wfh@chromium.org diff --git a/components/guest_view/common/guest_view_constants.cc b/components/guest_view/common/guest_view_constants.cc new file mode 100644 index 0000000..e68c3b8 --- /dev/null +++ b/components/guest_view/common/guest_view_constants.cc @@ -0,0 +1,45 @@ +// Copyright 2014 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 "components/guest_view/common/guest_view_constants.h" + +namespace guest_view { + +// Sizing attributes/parameters. +const char kAttributeAutoSize[] = "autosize"; +const char kAttributeMaxHeight[] = "maxheight"; +const char kAttributeMaxWidth[] = "maxwidth"; +const char kAttributeMinHeight[] = "minheight"; +const char kAttributeMinWidth[] = "minwidth"; +const char kElementWidth[] = "elementWidth"; +const char kElementHeight[] = "elementHeight"; +const char kElementSizeIsLogical[] = "elementSizeIsLogical"; + +// Events. +const char kEventResize[] = "guestViewInternal.onResize"; + +// Parameters/properties on events. +const char kCode[] = "code"; +const char kContentWindowID[] = "contentWindowId"; +const char kID[] = "id"; +const char kIsTopLevel[] = "isTopLevel"; +const char kNewWidth[] = "newWidth"; +const char kNewHeight[] = "newHeight"; +const char kOldWidth[] = "oldWidth"; +const char kOldHeight[] = "oldHeight"; +const char kReason[] = "reason"; +const char kUrl[] = "url"; +const char kUserGesture[] = "userGesture"; + +// Initialization parameters. +const char kParameterApi[] = "api"; +const char kParameterInstanceId[] = "instanceId"; + +// Other. +const char kGuestViewManagerKeyName[] = "guest_view_manager"; +const int kInstanceIDNone = 0; +const int kDefaultWidth = 300; +const int kDefaultHeight = 300; + +} // namespace guestview diff --git a/components/guest_view/common/guest_view_constants.h b/components/guest_view/common/guest_view_constants.h new file mode 100644 index 0000000..ef9066e --- /dev/null +++ b/components/guest_view/common/guest_view_constants.h @@ -0,0 +1,50 @@ +// Copyright 2014 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. + +// Constants used for the WebView API. + +#ifndef COMPONENTS_GUEST_VIEW_COMMON_GUEST_VIEW_CONSTANTS_H_ +#define COMPONENTS_GUEST_VIEW_COMMON_GUEST_VIEW_CONSTANTS_H_ + +namespace guest_view { + +// Sizing attributes/parameters. +extern const char kAttributeAutoSize[]; +extern const char kAttributeMaxHeight[]; +extern const char kAttributeMaxWidth[]; +extern const char kAttributeMinHeight[]; +extern const char kAttributeMinWidth[]; +extern const char kElementWidth[]; +extern const char kElementHeight[]; +extern const char kElementSizeIsLogical[]; + +// Events. +extern const char kEventResize[]; + +// Parameters/properties on events. +extern const char kCode[]; +extern const char kContentWindowID[]; +extern const char kID[]; +extern const char kIsTopLevel[]; +extern const char kNewWidth[]; +extern const char kNewHeight[]; +extern const char kOldWidth[]; +extern const char kOldHeight[]; +extern const char kReason[]; +extern const char kUrl[]; +extern const char kUserGesture[]; + +// Initialization parameters. +extern const char kParameterApi[]; +extern const char kParameterInstanceId[]; + +// Other. +extern const char kGuestViewManagerKeyName[]; +extern const int kInstanceIDNone; +extern const int kDefaultWidth; +extern const int kDefaultHeight; + +} // namespace guest_view + +#endif // COMPONENTS_GUEST_VIEW_COMMON_GUEST_VIEW_CONSTANTS_H_ diff --git a/components/guest_view/common/guest_view_message_generator.cc b/components/guest_view/common/guest_view_message_generator.cc new file mode 100644 index 0000000..6a0bca1 --- /dev/null +++ b/components/guest_view/common/guest_view_message_generator.cc @@ -0,0 +1,33 @@ +// Copyright 2015 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. + +// Get basic type definitions. +#define IPC_MESSAGE_IMPL +#include "components/guest_view/common/guest_view_message_generator.h" + +// Generate constructors. +#include "ipc/struct_constructor_macros.h" +#include "components/guest_view/common/guest_view_message_generator.h" + +// Generate destructors. +#include "ipc/struct_destructor_macros.h" +#include "components/guest_view/common/guest_view_message_generator.h" + +// Generate param traits write methods. +#include "ipc/param_traits_write_macros.h" +namespace IPC { +#include "components/guest_view/common/guest_view_message_generator.h" +} // namespace IPC + +// Generate param traits read methods. +#include "ipc/param_traits_read_macros.h" +namespace IPC { +#include "components/guest_view/common/guest_view_message_generator.h" +} // namespace IPC + +// Generate param traits log methods. +#include "ipc/param_traits_log_macros.h" +namespace IPC { +#include "components/guest_view/common/guest_view_message_generator.h" +} // namespace IPC diff --git a/components/guest_view/common/guest_view_message_generator.h b/components/guest_view/common/guest_view_message_generator.h new file mode 100644 index 0000000..0e569e2 --- /dev/null +++ b/components/guest_view/common/guest_view_message_generator.h @@ -0,0 +1,7 @@ +// Copyright 2015 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. + +// Multiply-included file, no traditional include guard. + +#include "components/guest_view/common/guest_view_messages.h" diff --git a/components/guest_view/common/guest_view_messages.h b/components/guest_view/common/guest_view_messages.h new file mode 100644 index 0000000..9772b6f --- /dev/null +++ b/components/guest_view/common/guest_view_messages.h @@ -0,0 +1,35 @@ +// Copyright 2015 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 GuestViews. +// Multiply-included message file, hence no include guard. + +#include "base/values.h" +#include "ipc/ipc_message_macros.h" + +#define IPC_MESSAGE_START GuestViewMsgStart + +// Messages sent from the browser to the renderer. + +// Once a RenderView proxy has been created for the guest in the embedder render +// process, this IPC informs the embedder of the proxy's routing ID. +IPC_MESSAGE_CONTROL2(GuestViewMsg_GuestAttached, + int /* element_instance_id */, + int /* source_routing_id */) + +// This IPC tells the browser process to detach the provided +// |element_instance_id| from a GuestViewBase if it is attached to one. +// In other words, routing of input and graphics will no longer flow through +// the container associated with the provided ID. +IPC_MESSAGE_CONTROL1(GuestViewMsg_GuestDetached, + int /* element_instance_id*/) + +// Messages sent from the renderer to the browser. + +// Sent by the renderer to set initialization parameters of a Browser Plugin +// that is identified by |element_instance_id|. +IPC_MESSAGE_CONTROL3(GuestViewHostMsg_AttachGuest, + int /* element_instance_id */, + int /* guest_instance_id */, + base::DictionaryValue /* attach_params */) |