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

Side by Side Diff: chrome/renderer/extensions/css_native_handler.cc

Issue 235943018: Move extensions bindings code out of //chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 6 years, 8 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
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/renderer/extensions/css_native_handler.h"
6
7 #include "chrome/renderer/extensions/chrome_v8_context.h"
8 #include "third_party/WebKit/public/platform/WebString.h"
9 #include "third_party/WebKit/public/web/WebScriptBindings.h"
10 #include "third_party/WebKit/public/web/WebSelector.h"
11
12 namespace extensions {
13
14 using blink::WebString;
15
16 CssNativeHandler::CssNativeHandler(ChromeV8Context* context)
17 : ObjectBackedNativeHandler(context) {
18 RouteFunction("CanonicalizeCompoundSelector",
19 base::Bind(&CssNativeHandler::CanonicalizeCompoundSelector,
20 base::Unretained(this)));
21 }
22
23 void CssNativeHandler::CanonicalizeCompoundSelector(
24 const v8::FunctionCallbackInfo<v8::Value>& args) {
25 CHECK_EQ(args.Length(), 1);
26 CHECK(args[0]->IsString());
27 WebString input_selector =
28 blink::WebScriptBindings::toWebString(args[0].As<v8::String>());
29 WebString output_selector = blink::canonicalizeSelector(
30 input_selector, blink::WebSelectorTypeCompound);
31 args.GetReturnValue().Set(blink::WebScriptBindings::toV8String(
32 output_selector, context()->v8_context()->GetIsolate()));
33 }
34
35 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/css_native_handler.h ('k') | chrome/renderer/extensions/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698