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

Side by Side Diff: chrome/browser/extensions/extension_proxy_api.cc

Issue 8869003: Move the "extension" namespace from extension_api.json into extension_api_extension.json. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build.py again? Created 9 years 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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // Implementation of the Chrome Extensions Proxy Settings API. 5 // Implementation of the Chrome Extensions Proxy Settings API.
6 6
7 #include "chrome/browser/extensions/extension_proxy_api.h" 7 #include "chrome/browser/extensions/extension_proxy_api.h"
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 91
92 ProxyPrefTransformer::~ProxyPrefTransformer() { 92 ProxyPrefTransformer::~ProxyPrefTransformer() {
93 } 93 }
94 94
95 Value* ProxyPrefTransformer::ExtensionToBrowserPref(const Value* extension_pref, 95 Value* ProxyPrefTransformer::ExtensionToBrowserPref(const Value* extension_pref,
96 std::string* error, 96 std::string* error,
97 bool* bad_message) { 97 bool* bad_message) {
98 // When ExtensionToBrowserPref is called, the format of |extension_pref| 98 // When ExtensionToBrowserPref is called, the format of |extension_pref|
99 // has been verified already by the extension API to match the schema 99 // has been verified already by the extension API to match the schema
100 // defined in chrome/common/extensions/api/extension_api.json. 100 // defined in the extension API JSON.
101 CHECK(extension_pref->IsType(Value::TYPE_DICTIONARY)); 101 CHECK(extension_pref->IsType(Value::TYPE_DICTIONARY));
102 const DictionaryValue* config = 102 const DictionaryValue* config =
103 static_cast<const DictionaryValue*>(extension_pref); 103 static_cast<const DictionaryValue*>(extension_pref);
104 104
105 // Extract the various pieces of information passed to 105 // Extract the various pieces of information passed to
106 // chrome.proxy.settings.set(). Several of these strings will 106 // chrome.proxy.settings.set(). Several of these strings will
107 // remain blank no respective values have been passed to set(). 107 // remain blank no respective values have been passed to set().
108 // If a values has been passed to set but could not be parsed, we bail 108 // If a values has been passed to set but could not be parsed, we bail
109 // out and return NULL. 109 // out and return NULL.
110 ProxyPrefs::ProxyMode mode_enum; 110 ProxyPrefs::ProxyMode mode_enum;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 if (!proxy_rules_dict) 175 if (!proxy_rules_dict)
176 return NULL; 176 return NULL;
177 extension_pref->Set(keys::kProxyConfigRules, proxy_rules_dict); 177 extension_pref->Set(keys::kProxyConfigRules, proxy_rules_dict);
178 break; 178 break;
179 } 179 }
180 case ProxyPrefs::kModeCount: 180 case ProxyPrefs::kModeCount:
181 NOTREACHED(); 181 NOTREACHED();
182 } 182 }
183 return extension_pref.release(); 183 return extension_pref.release();
184 } 184 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_proxy_api.h ('k') | chrome/browser/extensions/extension_proxy_api_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698