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

Side by Side Diff: extensions/renderer/api_bindings_system.cc

Issue 2718543004: [Extensions Bindings] Add ChromeSetting custom type (Closed)
Patch Set: rebase Created 3 years, 9 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
« no previous file with comments | « extensions/renderer/api_bindings_system.h ('k') | extensions/renderer/chrome_setting.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/api_bindings_system.h" 5 #include "extensions/renderer/api_bindings_system.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "extensions/renderer/api_binding_hooks.h" 10 #include "extensions/renderer/api_binding_hooks.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 custom_types_[type_name] = function; 124 custom_types_[type_name] = function;
125 } 125 }
126 126
127 v8::Local<v8::Object> APIBindingsSystem::CreateCustomType( 127 v8::Local<v8::Object> APIBindingsSystem::CreateCustomType(
128 v8::Local<v8::Context> context, 128 v8::Local<v8::Context> context,
129 const std::string& type_name, 129 const std::string& type_name,
130 const std::string& property_name) { 130 const std::string& property_name) {
131 auto iter = custom_types_.find(type_name); 131 auto iter = custom_types_.find(type_name);
132 DCHECK(iter != custom_types_.end()) << "Custom type not found: " << type_name; 132 DCHECK(iter != custom_types_.end()) << "Custom type not found: " << type_name;
133 return iter->second.Run(context, property_name, &request_handler_, 133 return iter->second.Run(context, property_name, &request_handler_,
134 &type_reference_map_); 134 &event_handler_, &type_reference_map_);
135 } 135 }
136 136
137 } // namespace extensions 137 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/api_bindings_system.h ('k') | extensions/renderer/chrome_setting.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698