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

Side by Side Diff: content/renderer/web_ui_bindings.cc

Issue 7242014: Update src/content/renderer to reflect WEBKIT_FRAME_TO_DOCUMENT_API_MOVE (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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 | « content/renderer/render_view.cc ('k') | content/renderer/webplugin_delegate_proxy.cc » ('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) 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 "content/renderer/web_ui_bindings.h" 5 #include "content/renderer/web_ui_bindings.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/stl_util-inl.h" 8 #include "base/stl_util-inl.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "content/common/view_messages.h" 10 #include "content/common/view_messages.h"
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h"
13 14
14 namespace { 15 namespace {
15 16
16 // Creates a Value which is a copy of the CppVariant |value|. All objects are 17 // Creates a Value which is a copy of the CppVariant |value|. All objects are
17 // treated as Lists for now since CppVariant does not distinguish arrays in any 18 // treated as Lists for now since CppVariant does not distinguish arrays in any
18 // convenient way and we currently have no need of non array objects. 19 // convenient way and we currently have no need of non array objects.
19 Value* CreateValueFromCppVariant(const CppVariant& value) { 20 Value* CreateValueFromCppVariant(const CppVariant& value) {
20 if (value.isBool()) 21 if (value.isBool())
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 if (args.size() == 2) { 75 if (args.size() == 2) {
75 if (!args[1].isObject()) 76 if (!args[1].isObject())
76 return; 77 return;
77 78
78 content.reset(CreateValueFromCppVariant(args[1])); 79 content.reset(CreateValueFromCppVariant(args[1]));
79 CHECK(content->IsType(Value::TYPE_LIST)); 80 CHECK(content->IsType(Value::TYPE_LIST));
80 } else { 81 } else {
81 content.reset(new ListValue()); 82 content.reset(new ListValue());
82 } 83 }
83 84
84 // Retrieve the source frame's url 85 // Retrieve the source document's url
85 GURL source_url; 86 GURL source_url;
86 WebKit::WebFrame* webframe = WebKit::WebFrame::frameForCurrentContext(); 87 WebKit::WebFrame* frame = WebKit::WebFrame::frameForCurrentContext();
87 if (webframe) 88 if (frame)
88 source_url = webframe->url(); 89 source_url = frame->document().url();
89 90
90 // Send the message up to the browser. 91 // Send the message up to the browser.
91 sender()->Send(new ViewHostMsg_WebUISend( 92 sender()->Send(new ViewHostMsg_WebUISend(
92 routing_id(), 93 routing_id(),
93 source_url, 94 source_url,
94 message, 95 message,
95 *(static_cast<ListValue*>(content.get())))); 96 *(static_cast<ListValue*>(content.get()))));
96 } 97 }
97 98
98 void DOMBoundBrowserObject::SetProperty(const std::string& name, 99 void DOMBoundBrowserObject::SetProperty(const std::string& name,
99 const std::string& value) { 100 const std::string& value) {
100 CppVariant* cpp_value = new CppVariant; 101 CppVariant* cpp_value = new CppVariant;
101 cpp_value->Set(value); 102 cpp_value->Set(value);
102 BindProperty(name, cpp_value); 103 BindProperty(name, cpp_value);
103 properties_.push_back(cpp_value); 104 properties_.push_back(cpp_value);
104 } 105 }
OLDNEW
« no previous file with comments | « content/renderer/render_view.cc ('k') | content/renderer/webplugin_delegate_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698