summaryrefslogtreecommitdiffstats
path: root/webkit/glue/context_menu.h
diff options
context:
space:
mode:
authorajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-17 03:23:46 +0000
committerajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-17 03:23:46 +0000
commit574a1d691c71e833638ccb1ca395dfa20c6835a4 (patch)
tree1d5f63a520c6b87fd74a19d57e9eaf4737bdd4fc /webkit/glue/context_menu.h
parent91cea0e774541297a46197d87e486cf8a4199775 (diff)
downloadchromium_src-574a1d691c71e833638ccb1ca395dfa20c6835a4.zip
chromium_src-574a1d691c71e833638ccb1ca395dfa20c6835a4.tar.gz
chromium_src-574a1d691c71e833638ccb1ca395dfa20c6835a4.tar.bz2
Begin implementation of the context menu for Video and Audio tags.
This code should enable the creation of a basic context menu for the Video and Audio tags. The actions for fullscreen, save screenshot, loop, and set playback rate are not yet implemented. BUG=15686 TEST=None Review URL: http://codereview.chromium.org/149604 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20931 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/context_menu.h')
-rw-r--r--webkit/glue/context_menu.h47
1 files changed, 44 insertions, 3 deletions
diff --git a/webkit/glue/context_menu.h b/webkit/glue/context_menu.h
index 69ea22f..e6c4660 100644
--- a/webkit/glue/context_menu.h
+++ b/webkit/glue/context_menu.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2009 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.
@@ -37,6 +37,12 @@ struct ContextNode {
// A misspelled word is selected
MISSPELLED_WORD = 0x40,
+
+ // A video node is selected
+ VIDEO = 0x80,
+
+ // A video node is selected
+ AUDIO = 0x100,
};
enum Capability {
@@ -55,6 +61,35 @@ struct ContextNode {
explicit ContextNode(int32 t) : type(t) {}
};
+// Parameters structure used in ContextMenuParams with attributes needed to
+// render the context menu for media elements.
+//
+// TODO(ajwong): Add support for multiple audio tracks and subtitles.
+struct ContextMenuMediaParams {
+ // Values for the bitfield representing the state of the media player.
+ // If the state is in ERROR, most media controls should disable
+ // themselves.
+ enum PlayerState {
+ PLAYER_NO_STATE = 0x0,
+ PLAYER_ERROR = 0x1,
+ PLAYER_PAUSED = 0x2,
+ PLAYER_MUTED = 0x4,
+ PLAYER_LOOP = 0x8,
+ PLAYER_CAN_SAVE = 0x10,
+ };
+
+ // A bitfield representing the current state of the player, such as
+ // playing, muted, etc.
+ int32 player_state;
+
+ // The current playback rate for this media element.
+ double playback_rate;
+
+ ContextMenuMediaParams()
+ : player_state(PLAYER_NO_STATE), playback_rate(1.0f) {
+ }
+};
+
// Parameters structure for ViewHostMsg_ContextMenu.
// FIXME(beng): This would be more useful in the future and more efficient
// if the parameters here weren't so literally mapped to what
@@ -78,8 +113,10 @@ struct ContextMenuParams {
// this field in the frontend process.
GURL unfiltered_link_url;
- // This is the URL of the image the context menu was invoked on.
- GURL image_url;
+ // This is the source URL for the element that the context menu was
+ // invoked on. Example of elements with source URLs are img, audio, and
+ // video.
+ GURL src_url;
// This is the URL of the top level page that the context menu was invoked
// on.
@@ -88,6 +125,10 @@ struct ContextMenuParams {
// This is the URL of the subframe that the context menu was invoked on.
GURL frame_url;
+ // These are the parameters for the media element that the context menu
+ // was invoked on.
+ ContextMenuMediaParams media_params;
+
// This is the text of the selection that the context menu was invoked on.
std::wstring selection_text;