| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // We don't swallow ViewMsg_CustomContextMenuAction because we listen for all | 146 // We don't swallow ViewMsg_CustomContextMenuAction because we listen for all |
| 147 // custom menu IDs, and not just our own. We don't swallow | 147 // custom menu IDs, and not just our own. We don't swallow |
| 148 // ViewMsg_LoadBlockedPlugins because multiple blocked plugins have an | 148 // ViewMsg_LoadBlockedPlugins because multiple blocked plugins have an |
| 149 // interest in it. | 149 // interest in it. |
| 150 if (message.type() == ViewMsg_CustomContextMenuAction::ID && | 150 if (message.type() == ViewMsg_CustomContextMenuAction::ID && |
| 151 gLastActiveMenu == this) { | 151 gLastActiveMenu == this) { |
| 152 ViewMsg_CustomContextMenuAction::Dispatch( | 152 ViewMsg_CustomContextMenuAction::Dispatch( |
| 153 &message, this, this, &BlockedPlugin::OnMenuItemSelected); | 153 &message, this, this, &BlockedPlugin::OnMenuItemSelected); |
| 154 } else { | 154 } else { |
| 155 IPC_BEGIN_MESSAGE_MAP(BlockedPlugin, message) | 155 IPC_BEGIN_MESSAGE_MAP(BlockedPlugin, message) |
| 156 IPC_MESSAGE_HANDLER(ViewMsg_LoadBlockedPlugins, OnLoadBlockedPlugins) | 156 IPC_MESSAGE_HANDLER(ChromeViewMsg_LoadBlockedPlugins, |
| 157 IPC_MESSAGE_HANDLER(ViewMsg_SetIsPrerendering, OnSetIsPrerendering) | 157 OnLoadBlockedPlugins) |
| 158 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetIsPrerendering, OnSetIsPrerendering) |
| 158 IPC_END_MESSAGE_MAP() | 159 IPC_END_MESSAGE_MAP() |
| 159 } | 160 } |
| 160 | 161 |
| 161 return false; | 162 return false; |
| 162 } | 163 } |
| 163 | 164 |
| 164 void BlockedPlugin::OnMenuItemSelected( | 165 void BlockedPlugin::OnMenuItemSelected( |
| 165 const webkit_glue::CustomContextMenuContext& /* ignored */, | 166 const webkit_glue::CustomContextMenuContext& /* ignored */, |
| 166 unsigned id) { | 167 unsigned id) { |
| 167 if (id == kMenuActionLoad) { | 168 if (id == kMenuActionLoad) { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 element = parent.toConst<WebElement>(); | 265 element = parent.toConst<WebElement>(); |
| 265 if (element.hasAttribute("style")) { | 266 if (element.hasAttribute("style")) { |
| 266 WebString style_str = element.getAttribute("style"); | 267 WebString style_str = element.getAttribute("style"); |
| 267 if (width_regex.match(style_str) >= 0 && | 268 if (width_regex.match(style_str) >= 0 && |
| 268 height_regex.match(style_str) >= 0) | 269 height_regex.match(style_str) >= 0) |
| 269 element.setAttribute("style", "display: none;"); | 270 element.setAttribute("style", "display: none;"); |
| 270 } | 271 } |
| 271 } | 272 } |
| 272 } | 273 } |
| 273 } | 274 } |
| OLD | NEW |