summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-08 01:07:08 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-08 01:07:08 +0000
commit6a906456c7d0f8fdd921dec21424240ec50c072a (patch)
tree363c8e5eb9b7b0deb1f043dd2e30a28df86421c6
parent8557c7ad2dda4453ec2c0a7810676302e39048a3 (diff)
downloadchromium_src-6a906456c7d0f8fdd921dec21424240ec50c072a.zip
chromium_src-6a906456c7d0f8fdd921dec21424240ec50c072a.tar.gz
chromium_src-6a906456c7d0f8fdd921dec21424240ec50c072a.tar.bz2
Move cpp_binding_example.* to content/renderer/
BUG=265753 TEST=content_browsertests R=jam@chromium.org,jamesr@chromium.org Review URL: https://chromiumcodereview.appspot.com/22324003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216340 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/content_tests.gypi12
-rw-r--r--content/renderer/cpp_bound_class_unittest.cc3
-rw-r--r--content/test/cpp_binding_example.cc (renamed from webkit/renderer/cpp_binding_example.cc)17
-rw-r--r--content/test/cpp_binding_example.h (renamed from webkit/renderer/cpp_binding_example.h)34
4 files changed, 35 insertions, 31 deletions
diff --git a/content/content_tests.gypi b/content/content_tests.gypi
index 7ce4ea0..bbd785c 100644
--- a/content/content_tests.gypi
+++ b/content/content_tests.gypi
@@ -843,12 +843,12 @@
'browser/webkit_browsertest.cc',
'browser/worker_host/test/worker_browsertest.cc',
'renderer/accessibility/renderer_accessibility_browsertest.cc',
- 'renderer/browser_plugin/mock_browser_plugin.h',
+ 'renderer/browser_plugin/browser_plugin_browsertest.cc',
+ 'renderer/browser_plugin/browser_plugin_browsertest.h',
'renderer/browser_plugin/mock_browser_plugin.cc',
- 'renderer/browser_plugin/mock_browser_plugin_manager.h',
+ 'renderer/browser_plugin/mock_browser_plugin.h',
'renderer/browser_plugin/mock_browser_plugin_manager.cc',
- 'renderer/browser_plugin/browser_plugin_browsertest.h',
- 'renderer/browser_plugin/browser_plugin_browsertest.cc',
+ 'renderer/browser_plugin/mock_browser_plugin_manager.h',
'renderer/cpp_bound_class_unittest.cc',
'renderer/dom_serializer_browsertest.cc',
'renderer/mouse_lock_dispatcher_browsertest.cc',
@@ -873,8 +873,8 @@
'test/content_browser_test_utils_mac.mm',
'test/content_browser_test_test.cc',
'test/content_test_launcher.cc',
- '../webkit/renderer/cpp_binding_example.cc',
- '../webkit/renderer/cpp_binding_example.h',
+ 'test/cpp_binding_example.cc',
+ 'test/cpp_binding_example.h',
],
'conditions': [
['chromeos==0', {
diff --git a/content/renderer/cpp_bound_class_unittest.cc b/content/renderer/cpp_bound_class_unittest.cc
index 29c2fd4..2c0f75f 100644
--- a/content/renderer/cpp_bound_class_unittest.cc
+++ b/content/renderer/cpp_bound_class_unittest.cc
@@ -10,13 +10,12 @@
#include "content/public/common/url_constants.h"
#include "content/public/renderer/render_view_observer.h"
#include "content/public/test/render_view_test.h"
+#include "content/test/cpp_binding_example.h"
#include "third_party/WebKit/public/platform/WebURLRequest.h"
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebElement.h"
-#include "webkit/renderer/cpp_binding_example.h"
using webkit_glue::CppArgumentList;
-using webkit_glue::CppBindingExample;
using webkit_glue::CppVariant;
namespace content {
diff --git a/webkit/renderer/cpp_binding_example.cc b/content/test/cpp_binding_example.cc
index 43b4ede..3c7630d 100644
--- a/webkit/renderer/cpp_binding_example.cc
+++ b/content/test/cpp_binding_example.cc
@@ -1,18 +1,19 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// This file contains the definition for CppBindingExample, which is used in
-// cpp_bound_class_unittest.
-
-#include "cpp_binding_example.h"
+#include "content/test/cpp_binding_example.h"
#include <stdio.h>
#include "base/bind.h"
#include "base/bind_helpers.h"
-namespace webkit_glue {
+using webkit_glue::CppArgumentList;
+using webkit_glue::CppBoundClass;
+using webkit_glue::CppVariant;
+
+namespace content {
namespace {
@@ -32,7 +33,7 @@ class PropertyCallbackExample : public CppBoundClass::PropertyCallback {
CppVariant value_;
};
-}
+} // namespace
CppBindingExample::CppBindingExample() {
// Map properties. It's recommended, but not required, that the JavaScript
@@ -134,4 +135,4 @@ void CppBindingExample::fallbackMethod(const CppArgumentList& args,
printf("Error: unknown JavaScript method invoked.\n");
}
-} // namespace webkit_glue
+} // namespace content
diff --git a/webkit/renderer/cpp_binding_example.h b/content/test/cpp_binding_example.h
index ee8568d..f594ae7 100644
--- a/webkit/renderer/cpp_binding_example.h
+++ b/content/test/cpp_binding_example.h
@@ -1,7 +1,10 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#ifndef CONTENT_TEST_CPP_BINDING_EXAMPLE_H_
+#define CONTENT_TEST_CPP_BINDING_EXAMPLE_H_
+
/*
CppBindingExample class:
This provides an example of how to use the CppBoundClass to create methods
@@ -30,14 +33,11 @@
</script>
*/
-#ifndef CPP_BINDING_EXAMPLE_H__
-#define CPP_BINDING_EXAMPLE_H__
-
#include "webkit/renderer/cpp_bound_class.h"
-namespace webkit_glue {
+namespace content {
-class CppBindingExample : public CppBoundClass {
+class CppBindingExample : public webkit_glue::CppBoundClass {
public:
// The default constructor initializes the property and method lists needed
// to bind this class to a JS object.
@@ -55,28 +55,32 @@ class CppBindingExample : public CppBoundClass {
//
// Returns the value that was passed in as its first (only) argument.
- void echoValue(const CppArgumentList& args, CppVariant* result);
+ void echoValue(const webkit_glue::CppArgumentList& args,
+ webkit_glue::CppVariant* result);
// Returns a hard-coded value of the same type (bool, number (double),
// string, or null) that was passed in as an argument.
- void echoType(const CppArgumentList& args, CppVariant* result);
+ void echoType(const webkit_glue::CppArgumentList& args,
+ webkit_glue::CppVariant* result);
// Returns the sum of the (first) two arguments as a double, if they are both
// numbers (integers or doubles). Otherwise returns null.
- void plus(const CppArgumentList& args, CppVariant* result);
+ void plus(const webkit_glue::CppArgumentList& args,
+ webkit_glue::CppVariant* result);
// Always returns the same value -- an example of a read-only property.
- void same(CppVariant* result);
+ void same(webkit_glue::CppVariant* result);
// Invoked when a nonexistent method is called on this example object, this
// prints an error message.
- void fallbackMethod(const CppArgumentList& args, CppVariant* result);
+ void fallbackMethod(const webkit_glue::CppArgumentList& args,
+ webkit_glue::CppVariant* result);
// These properties will also be exposed to JavaScript.
- CppVariant my_value;
- CppVariant my_other_value;
+ webkit_glue::CppVariant my_value;
+ webkit_glue::CppVariant my_other_value;
};
-} // namespace webkit_glue
+} // namespace content
-#endif // CPP_BINDING_EXAMPLE_H__
+#endif // CONTENT_TEST_CPP_BINDING_EXAMPLE_H_