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

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

Issue 10382059: Quote CppBoundClass/CppVariant in namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix a long line Created 8 years, 7 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
OLDNEW
1 // Copyright (c) 2011 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 "content/renderer/web_ui_bindings.h" 5 #include "content/renderer/web_ui_bindings.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/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
11 #include "base/values.h" 11 #include "base/values.h"
12 #include "content/common/view_messages.h" 12 #include "content/common/view_messages.h"
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" 15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
16 16
17 using webkit_glue::CppArgumentList;
18 using webkit_glue::CppVariant;
19
17 namespace { 20 namespace {
18 21
19 // Creates a Value which is a copy of the CppVariant |value|. All objects are 22 // Creates a Value which is a copy of the CppVariant |value|. All objects are
20 // treated as Lists for now since CppVariant does not distinguish arrays in any 23 // treated as Lists for now since CppVariant does not distinguish arrays in any
21 // convenient way and we currently have no need of non array objects. 24 // convenient way and we currently have no need of non array objects.
22 Value* CreateValueFromCppVariant(const CppVariant& value) { 25 Value* CreateValueFromCppVariant(const CppVariant& value) {
23 if (value.isBool()) 26 if (value.isBool())
24 return Value::CreateBooleanValue(value.ToBoolean()); 27 return Value::CreateBooleanValue(value.ToBoolean());
25 if (value.isDouble()) 28 if (value.isDouble())
26 return Value::CreateDoubleValue(value.ToDouble()); 29 return Value::CreateDoubleValue(value.ToDouble());
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 *(static_cast<ListValue*>(content.get())))); 101 *(static_cast<ListValue*>(content.get()))));
99 } 102 }
100 103
101 void DOMBoundBrowserObject::SetProperty(const std::string& name, 104 void DOMBoundBrowserObject::SetProperty(const std::string& name,
102 const std::string& value) { 105 const std::string& value) {
103 CppVariant* cpp_value = new CppVariant; 106 CppVariant* cpp_value = new CppVariant;
104 cpp_value->Set(value); 107 cpp_value->Set(value);
105 BindProperty(name, cpp_value); 108 BindProperty(name, cpp_value);
106 properties_.push_back(cpp_value); 109 properties_.push_back(cpp_value);
107 } 110 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698