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

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

Issue 7753020: Revert recent changes to base::Value (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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/browser/speech/speech_recognition_request.cc ('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) 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.h" 8 #include "base/stl_util.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"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 const std::string message = args[0].ToString(); 70 const std::string message = args[0].ToString();
71 71
72 // If they've provided an optional message parameter, convert that into a 72 // If they've provided an optional message parameter, convert that into a
73 // Value to send to the browser process. 73 // Value to send to the browser process.
74 scoped_ptr<Value> content; 74 scoped_ptr<Value> content;
75 if (args.size() == 2) { 75 if (args.size() == 2) {
76 if (!args[1].isObject()) 76 if (!args[1].isObject())
77 return; 77 return;
78 78
79 content.reset(CreateValueFromCppVariant(args[1])); 79 content.reset(CreateValueFromCppVariant(args[1]));
80 CHECK(content->AsList()); 80 CHECK(content->IsType(Value::TYPE_LIST));
81 } else { 81 } else {
82 content.reset(new ListValue()); 82 content.reset(new ListValue());
83 } 83 }
84 84
85 // Retrieve the source document's url 85 // Retrieve the source document's url
86 GURL source_url; 86 GURL source_url;
87 WebKit::WebFrame* frame = WebKit::WebFrame::frameForCurrentContext(); 87 WebKit::WebFrame* frame = WebKit::WebFrame::frameForCurrentContext();
88 if (frame) 88 if (frame)
89 source_url = frame->document().url(); 89 source_url = frame->document().url();
90 90
91 // Send the message up to the browser. 91 // Send the message up to the browser.
92 sender()->Send(new ViewHostMsg_WebUISend( 92 sender()->Send(new ViewHostMsg_WebUISend(
93 routing_id(), 93 routing_id(),
94 source_url, 94 source_url,
95 message, 95 message,
96 *(static_cast<ListValue*>(content.get())))); 96 *(static_cast<ListValue*>(content.get()))));
97 } 97 }
98 98
99 void DOMBoundBrowserObject::SetProperty(const std::string& name, 99 void DOMBoundBrowserObject::SetProperty(const std::string& name,
100 const std::string& value) { 100 const std::string& value) {
101 CppVariant* cpp_value = new CppVariant; 101 CppVariant* cpp_value = new CppVariant;
102 cpp_value->Set(value); 102 cpp_value->Set(value);
103 BindProperty(name, cpp_value); 103 BindProperty(name, cpp_value);
104 properties_.push_back(cpp_value); 104 properties_.push_back(cpp_value);
105 } 105 }
OLDNEW
« no previous file with comments | « content/browser/speech/speech_recognition_request.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698