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

Unified Diff: webkit/port/bindings/v8/extensions/Gears.cpp

Issue 40132: Refactor v8 extensions to make registration avoid having to use ChromiumBridg... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: webkit/port/bindings/v8/extensions/Gears.cpp
===================================================================
--- webkit/port/bindings/v8/extensions/Gears.cpp (revision 10914)
+++ webkit/port/bindings/v8/extensions/Gears.cpp (working copy)
@@ -1,45 +0,0 @@
-// Copyright (c) 2006-2009 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.
-
-#include "config.h"
-#include "Gears.h"
-
-namespace WebCore {
-
-const char* kGearsExtensionName = "v8/Gears";
-
-// Note: when a page touches the "google.gears.factory" object, this script
-// touches the DOM. We expect the DOM to be available at that time.
-const char* kGearsExtensionScript =
- "var google;"
- "if (!google)"
- " google = {};"
- "if (!google.gears)"
- " google.gears = {};"
- "(function() {"
- " var factory = null;"
- " google.gears.__defineGetter__('factory', function() {"
- " if (!factory) {"
- " factory = document.createElement('object');"
- " factory.width = 0;"
- " factory.height = 0;"
- " factory.style.visibility = 'hidden';"
- " factory.type = 'application/x-googlegears';"
- " document.documentElement.appendChild(factory);"
- " }"
- " return factory;"
- " });"
- "})();";
-
-class GearsExtensionWrapper : public v8::Extension {
-public:
- GearsExtensionWrapper() :
- v8::Extension(kGearsExtensionName, kGearsExtensionScript) {}
-};
-
-v8::Extension* GearsExtension::Get() {
- return new GearsExtensionWrapper();
-}
-
-}

Powered by Google App Engine
This is Rietveld 408576698