OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/renderer/process_info_native_handler.h" | 5 #include "extensions/renderer/process_info_native_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "extensions/renderer/script_context.h" | 9 #include "extensions/renderer/script_context.h" |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 args.GetReturnValue().Set(v8::String::NewFromUtf8( | 71 args.GetReturnValue().Set(v8::String::NewFromUtf8( |
72 args.GetIsolate(), | 72 args.GetIsolate(), |
73 "sendRequest and onRequest are obsolete." | 73 "sendRequest and onRequest are obsolete." |
74 " Please use sendMessage and onMessage instead.")); | 74 " Please use sendMessage and onMessage instead.")); |
75 } | 75 } |
76 } | 76 } |
77 | 77 |
78 void ProcessInfoNativeHandler::HasSwitch( | 78 void ProcessInfoNativeHandler::HasSwitch( |
79 const v8::FunctionCallbackInfo<v8::Value>& args) { | 79 const v8::FunctionCallbackInfo<v8::Value>& args) { |
80 CHECK(args.Length() == 1 && args[0]->IsString()); | 80 CHECK(args.Length() == 1 && args[0]->IsString()); |
81 bool has_switch = CommandLine::ForCurrentProcess()->HasSwitch( | 81 bool has_switch = base::CommandLine::ForCurrentProcess()->HasSwitch( |
82 *v8::String::Utf8Value(args[0])); | 82 *v8::String::Utf8Value(args[0])); |
83 args.GetReturnValue().Set(v8::Boolean::New(args.GetIsolate(), has_switch)); | 83 args.GetReturnValue().Set(v8::Boolean::New(args.GetIsolate(), has_switch)); |
84 } | 84 } |
85 | 85 |
86 } // namespace extensions | 86 } // namespace extensions |
OLD | NEW |