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

Side by Side Diff: chrome/renderer/extensions/extension_helper.cc

Issue 11028125: Remove legacy draggable region code and refactor to share common draggable region code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/extensions/extension_messages.h ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/extensions/extension_helper.h" 5 #include "chrome/renderer/extensions/extension_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/json/json_string_value_serializer.h" 10 #include "base/json/json_string_value_serializer.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 } 258 }
259 259
260 void ExtensionHelper::DraggableRegionsChanged(WebKit::WebFrame* frame) { 260 void ExtensionHelper::DraggableRegionsChanged(WebKit::WebFrame* frame) {
261 WebKit::WebVector<WebKit::WebDraggableRegion> webregions = 261 WebKit::WebVector<WebKit::WebDraggableRegion> webregions =
262 frame->document().draggableRegions(); 262 frame->document().draggableRegions();
263 std::vector<extensions::DraggableRegion> regions; 263 std::vector<extensions::DraggableRegion> regions;
264 for (size_t i = 0; i < webregions.size(); ++i) { 264 for (size_t i = 0; i < webregions.size(); ++i) {
265 extensions::DraggableRegion region; 265 extensions::DraggableRegion region;
266 region.bounds = webregions[i].bounds; 266 region.bounds = webregions[i].bounds;
267 region.draggable = webregions[i].draggable; 267 region.draggable = webregions[i].draggable;
268
269 // TODO(jianli): to be removed after WebKit patch that changes the draggable
270 // region syntax is landed.
271 region.label = UTF16ToASCII(webregions[i].label);
272 region.clip = webregions[i].clip;
273
274 regions.push_back(region); 268 regions.push_back(region);
275 } 269 }
276 Send(new ExtensionHostMsg_UpdateDraggableRegions(routing_id(), regions)); 270 Send(new ExtensionHostMsg_UpdateDraggableRegions(routing_id(), regions));
277 } 271 }
278 272
279 void ExtensionHelper::FrameDetached(WebFrame* frame) { 273 void ExtensionHelper::FrameDetached(WebFrame* frame) {
280 // This could be called before DidCreateDataSource, in which case the frame 274 // This could be called before DidCreateDataSource, in which case the frame
281 // won't be in the map. 275 // won't be in the map.
282 SchedulerMap::iterator i = g_schedulers.Get().find(frame); 276 SchedulerMap::iterator i = g_schedulers.Get().find(frame);
283 if (i == g_schedulers.Get().end()) 277 if (i == g_schedulers.Get().end())
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 case content::CONSOLE_MESSAGE_LEVEL_ERROR: 524 case content::CONSOLE_MESSAGE_LEVEL_ERROR:
531 target_level = WebConsoleMessage::LevelError; 525 target_level = WebConsoleMessage::LevelError;
532 break; 526 break;
533 } 527 }
534 render_view()->GetWebView()->mainFrame()->addMessageToConsole( 528 render_view()->GetWebView()->mainFrame()->addMessageToConsole(
535 WebConsoleMessage(target_level, message)); 529 WebConsoleMessage(target_level, message));
536 } 530 }
537 } 531 }
538 532
539 } // namespace extensions 533 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_messages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698