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 <stdint.h> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/command_line.h" | 10 #include "base/command_line.h" |
9 #include "extensions/renderer/script_context.h" | 11 #include "extensions/renderer/script_context.h" |
10 | 12 |
11 namespace extensions { | 13 namespace extensions { |
12 | 14 |
13 ProcessInfoNativeHandler::ProcessInfoNativeHandler( | 15 ProcessInfoNativeHandler::ProcessInfoNativeHandler( |
14 ScriptContext* context, | 16 ScriptContext* context, |
15 const std::string& extension_id, | 17 const std::string& extension_id, |
16 const std::string& context_type, | 18 const std::string& context_type, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 89 |
88 void ProcessInfoNativeHandler::HasSwitch( | 90 void ProcessInfoNativeHandler::HasSwitch( |
89 const v8::FunctionCallbackInfo<v8::Value>& args) { | 91 const v8::FunctionCallbackInfo<v8::Value>& args) { |
90 CHECK(args.Length() == 1 && args[0]->IsString()); | 92 CHECK(args.Length() == 1 && args[0]->IsString()); |
91 bool has_switch = base::CommandLine::ForCurrentProcess()->HasSwitch( | 93 bool has_switch = base::CommandLine::ForCurrentProcess()->HasSwitch( |
92 *v8::String::Utf8Value(args[0])); | 94 *v8::String::Utf8Value(args[0])); |
93 args.GetReturnValue().Set(v8::Boolean::New(args.GetIsolate(), has_switch)); | 95 args.GetReturnValue().Set(v8::Boolean::New(args.GetIsolate(), has_switch)); |
94 } | 96 } |
95 | 97 |
96 } // namespace extensions | 98 } // namespace extensions |
OLD | NEW |