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

Unified Diff: chrome/browser/tab_contents/render_view_context_menu.cc

Issue 251103: Move MediaPlayerAction to WebMediaPlayerAction. Switch to an enum and a... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | « chrome/browser/tab_contents/render_view_context_menu.h ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/render_view_context_menu.cc
===================================================================
--- chrome/browser/tab_contents/render_view_context_menu.cc (revision 28235)
+++ chrome/browser/tab_contents/render_view_context_menu.cc (working copy)
@@ -29,8 +29,10 @@
#include "chrome/common/url_constants.h"
#include "grit/generated_resources.h"
#include "net/base/escape.h"
-#include "webkit/glue/media_player_action.h"
+#include "webkit/api/public/WebMediaPlayerAction.h"
+using WebKit::WebMediaPlayerAction;
+
namespace {
string16 EscapeAmpersands(const string16& text) {
@@ -543,43 +545,38 @@
case IDS_CONTENT_CONTEXT_PLAY:
UserMetrics::RecordAction(L"MediaContextMenu_Play", profile_);
- MediaPlayerActionAt(params_.x,
- params_.y,
- MediaPlayerAction(MediaPlayerAction::PLAY));
+ MediaPlayerActionAt(gfx::Point(params_.x, params_.y),
+ WebMediaPlayerAction(
+ WebMediaPlayerAction::Play, true));
break;
case IDS_CONTENT_CONTEXT_PAUSE:
UserMetrics::RecordAction(L"MediaContextMenu_Pause", profile_);
- MediaPlayerActionAt(params_.x,
- params_.y,
- MediaPlayerAction(MediaPlayerAction::PAUSE));
+ MediaPlayerActionAt(gfx::Point(params_.x, params_.y),
+ WebMediaPlayerAction(
+ WebMediaPlayerAction::Play, false));
break;
case IDS_CONTENT_CONTEXT_MUTE:
UserMetrics::RecordAction(L"MediaContextMenu_Mute", profile_);
- MediaPlayerActionAt(params_.x,
- params_.y,
- MediaPlayerAction(MediaPlayerAction::MUTE));
+ MediaPlayerActionAt(gfx::Point(params_.x, params_.y),
+ WebMediaPlayerAction(
+ WebMediaPlayerAction::Mute, true));
break;
case IDS_CONTENT_CONTEXT_UNMUTE:
UserMetrics::RecordAction(L"MediaContextMenu_Unmute", profile_);
- MediaPlayerActionAt(params_.x,
- params_.y,
- MediaPlayerAction(MediaPlayerAction::UNMUTE));
+ MediaPlayerActionAt(gfx::Point(params_.x, params_.y),
+ WebMediaPlayerAction(
+ WebMediaPlayerAction::Mute, false));
break;
case IDS_CONTENT_CONTEXT_LOOP:
UserMetrics::RecordAction(L"MediaContextMenu_Loop", profile_);
- if (ItemIsChecked(IDS_CONTENT_CONTEXT_LOOP)) {
- MediaPlayerActionAt(params_.x,
- params_.y,
- MediaPlayerAction(MediaPlayerAction::NO_LOOP));
- } else {
- MediaPlayerActionAt(params_.x,
- params_.y,
- MediaPlayerAction(MediaPlayerAction::LOOP));
- }
+ MediaPlayerActionAt(gfx::Point(params_.x, params_.y),
+ WebMediaPlayerAction(
+ WebMediaPlayerAction::Loop,
+ !ItemIsChecked(IDS_CONTENT_CONTEXT_LOOP)));
break;
case IDS_CONTENT_CONTEXT_BACK:
@@ -809,8 +806,8 @@
}
void RenderViewContextMenu::MediaPlayerActionAt(
- int x,
- int y,
- const MediaPlayerAction& action) {
- source_tab_contents_->render_view_host()->MediaPlayerActionAt(x, y, action);
+ const gfx::Point& location,
+ const WebMediaPlayerAction& action) {
+ source_tab_contents_->render_view_host()->MediaPlayerActionAt(
+ location, action);
}
« no previous file with comments | « chrome/browser/tab_contents/render_view_context_menu.h ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698