summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/renderer/renderer_glue.cc11
-rw-r--r--webkit/glue/webkit_glue.h4
-rwxr-xr-xwebkit/tools/test_shell/test_shell.cc8
3 files changed, 20 insertions, 3 deletions
diff --git a/chrome/renderer/renderer_glue.cc b/chrome/renderer/renderer_glue.cc
index 67dc679..fa2a87a 100644
--- a/chrome/renderer/renderer_glue.cc
+++ b/chrome/renderer/renderer_glue.cc
@@ -12,7 +12,6 @@
#endif
#include "base/clipboard.h"
-#include "base/command_line.h"
#include "base/scoped_clipboard_writer.h"
#include "base/string_util.h"
#include "chrome/renderer/net/render_dns_master.h"
@@ -144,8 +143,16 @@ ScopedClipboardWriterGlue::~ScopedClipboardWriterGlue() {
namespace webkit_glue {
+// Global variable set during RenderProcess::GlobalInit if video was enabled
+// and our media libraries were successfully loaded.
+static bool g_media_player_available = false;
+
+void SetMediaPlayerAvailable(bool value) {
+ g_media_player_available = value;
+}
+
bool IsMediaPlayerAvailable() {
- return CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableVideo);
+ return g_media_player_available;
}
void PrefetchDns(const std::string& hostname) {
diff --git a/webkit/glue/webkit_glue.h b/webkit/glue/webkit_glue.h
index 3ef990c..44dc8a4 100644
--- a/webkit/glue/webkit_glue.h
+++ b/webkit/glue/webkit_glue.h
@@ -142,6 +142,10 @@ bool DecodeImage(const std::string& image_data, SkBitmap* image);
//-----------------------------------------------------------------------------
// Functions implemented by the embedder, called by WebKit:
+// Set during RenderProcess::GlobalInit when --enable-video has been passed in
+// and all media related libraries were successfully loaded.
+void SetMediaPlayerAvailable(bool value);
+
// This function is called from WebCore::MediaPlayerPrivate,
// Returns true if media player is available and can be created.
bool IsMediaPlayerAvailable();
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc
index e6455a8..aa9dca7 100755
--- a/webkit/tools/test_shell/test_shell.cc
+++ b/webkit/tools/test_shell/test_shell.cc
@@ -541,8 +541,14 @@ void TestShell::SetFocus(WebWidgetHost* host, bool enable) {
namespace webkit_glue {
+static bool g_media_player_available = false;
+
+void SetMediaPlayerAvailable(bool value) {
+ g_media_player_available = value;
+}
+
bool IsMediaPlayerAvailable() {
- return CommandLine::ForCurrentProcess()->HasSwitch(test_shell::kEnableVideo);
+ return g_media_player_available;
}
void PrefetchDns(const std::string& hostname) {}