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

Side by Side Diff: chrome/renderer/blocked_plugin.cc

Issue 6253017: Pepper/Flapper: First pass at context menu implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make brettw happier Created 9 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/blocked_plugin.h ('k') | chrome/renderer/pepper_plugin_delegate_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/blocked_plugin.h" 5 #include "chrome/renderer/blocked_plugin.h"
6 6
7 #include "base/string_piece.h" 7 #include "base/string_piece.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/common/jstemplate_builder.h" 10 #include "chrome/common/jstemplate_builder.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } else if (message.type() == ViewMsg_LoadBlockedPlugins::ID) { 140 } else if (message.type() == ViewMsg_LoadBlockedPlugins::ID) {
141 LoadPlugin(); 141 LoadPlugin();
142 } else if (message.type() == ViewMsg_DisplayPrerenderedPage::ID) { 142 } else if (message.type() == ViewMsg_DisplayPrerenderedPage::ID) {
143 if (is_blocked_for_prerendering_) 143 if (is_blocked_for_prerendering_)
144 LoadPlugin(); 144 LoadPlugin();
145 } 145 }
146 146
147 return false; 147 return false;
148 } 148 }
149 149
150 void BlockedPlugin::OnMenuItemSelected(unsigned id) { 150 void BlockedPlugin::OnMenuItemSelected(
151 const webkit_glue::CustomContextMenuContext& /* ignored */,
152 unsigned id) {
151 if (id == kMenuActionLoad) { 153 if (id == kMenuActionLoad) {
152 LoadPlugin(); 154 LoadPlugin();
153 } else if (id == kMenuActionRemove) { 155 } else if (id == kMenuActionRemove) {
154 HidePlugin(); 156 HidePlugin();
155 } 157 }
156 } 158 }
157 159
158 void BlockedPlugin::LoadPlugin() { 160 void BlockedPlugin::LoadPlugin() {
159 CHECK(plugin_); 161 CHECK(plugin_);
160 // This is not strictly necessary but is an important defense in case the 162 // This is not strictly necessary but is an important defense in case the
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 if (element.hasAttribute("style")) { 227 if (element.hasAttribute("style")) {
226 WebString style_str = element.getAttribute("style"); 228 WebString style_str = element.getAttribute("style");
227 if (width_regex.match(style_str) >= 0 && 229 if (width_regex.match(style_str) >= 0 &&
228 height_regex.match(style_str) >= 0) 230 height_regex.match(style_str) >= 0)
229 element.setAttribute("style", "display: none;"); 231 element.setAttribute("style", "display: none;");
230 } 232 }
231 } 233 }
232 } 234 }
233 } 235 }
234 236
OLDNEW
« no previous file with comments | « chrome/renderer/blocked_plugin.h ('k') | chrome/renderer/pepper_plugin_delegate_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698