Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Unified Diff: webkit/glue/context_menu.h

Issue 149604: Begin implementation of the context menu for Video and Audio tags. (Closed)
Patch Set: Fix small style issues. Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/api/src/WebMediaPlayerClientImpl.cpp ('k') | webkit/glue/context_menu_client_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/context_menu.h
diff --git a/webkit/glue/context_menu.h b/webkit/glue/context_menu.h
index 69ea22ff6bff71a61a5c547591de00017a95285b..e6c4660882c7f8aa46cc7393bbd2b1f50ee50c62 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;
« no previous file with comments | « webkit/api/src/WebMediaPlayerClientImpl.cpp ('k') | webkit/glue/context_menu_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698