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

Side by Side Diff: chrome/browser/extensions/api/management/chrome_management_api_delegate.cc

Issue 1214903010: Make JSONParser a pure interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: review Created 5 years, 5 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
OLDNEW
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 "chrome/browser/extensions/api/management/chrome_management_api_delegat e.h" 5 #include "chrome/browser/extensions/api/management/chrome_management_api_delegat e.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/extensions/bookmark_app_helper.h" 8 #include "chrome/browser/extensions/bookmark_app_helper.h"
9 #include "chrome/browser/extensions/chrome_requirements_checker.h" 9 #include "chrome/browser/extensions/chrome_requirements_checker.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 extensions::LaunchType ChromeManagementAPIDelegate::GetLaunchType( 177 extensions::LaunchType ChromeManagementAPIDelegate::GetLaunchType(
178 const extensions::ExtensionPrefs* prefs, 178 const extensions::ExtensionPrefs* prefs,
179 const extensions::Extension* extension) const { 179 const extensions::Extension* extension) const {
180 return extensions::GetLaunchType(prefs, extension); 180 return extensions::GetLaunchType(prefs, extension);
181 } 181 }
182 182
183 void ChromeManagementAPIDelegate:: 183 void ChromeManagementAPIDelegate::
184 GetPermissionWarningsByManifestFunctionDelegate( 184 GetPermissionWarningsByManifestFunctionDelegate(
185 extensions::ManagementGetPermissionWarningsByManifestFunction* function, 185 extensions::ManagementGetPermissionWarningsByManifestFunction* function,
186 const std::string& manifest_str) const { 186 const std::string& manifest_str) const {
187 scoped_refptr<safe_json::SafeJsonParser> parser( 187 safe_json::SafeJsonParser::Parse(
188 new safe_json::SafeJsonParser( 188 manifest_str,
189 manifest_str, 189 base::Bind(
190 base::Bind( 190 &extensions::ManagementGetPermissionWarningsByManifestFunction::
191 &extensions::ManagementGetPermissionWarningsByManifestFunction:: 191 OnParseSuccess,
192 OnParseSuccess, 192 function),
193 function), 193 base::Bind(
194 base::Bind( 194 &extensions::ManagementGetPermissionWarningsByManifestFunction::
195 &extensions::ManagementGetPermissionWarningsByManifestFunction:: 195 OnParseFailure,
196 OnParseFailure, 196 function));
197 function)));
198 parser->Start();
199 } 197 }
200 198
201 scoped_ptr<extensions::InstallPromptDelegate> 199 scoped_ptr<extensions::InstallPromptDelegate>
202 ChromeManagementAPIDelegate::SetEnabledFunctionDelegate( 200 ChromeManagementAPIDelegate::SetEnabledFunctionDelegate(
203 extensions::ManagementSetEnabledFunction* function, 201 extensions::ManagementSetEnabledFunction* function,
204 const extensions::Extension* extension) const { 202 const extensions::Extension* extension) const {
205 return scoped_ptr<ManagementSetEnabledFunctionInstallPromptDelegate>( 203 return scoped_ptr<ManagementSetEnabledFunctionInstallPromptDelegate>(
206 new ManagementSetEnabledFunctionInstallPromptDelegate(function, 204 new ManagementSetEnabledFunctionInstallPromptDelegate(function,
207 extension)); 205 extension));
208 } 206 }
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 310
313 GURL ChromeManagementAPIDelegate::GetIconURL( 311 GURL ChromeManagementAPIDelegate::GetIconURL(
314 const extensions::Extension* extension, 312 const extensions::Extension* extension,
315 int icon_size, 313 int icon_size,
316 ExtensionIconSet::MatchType match, 314 ExtensionIconSet::MatchType match,
317 bool grayscale, 315 bool grayscale,
318 bool* exists) const { 316 bool* exists) const {
319 return extensions::ExtensionIconSource::GetIconURL(extension, icon_size, 317 return extensions::ExtensionIconSource::GetIconURL(extension, icon_size,
320 match, grayscale, exists); 318 match, grayscale, exists);
321 } 319 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/webstore_data_fetcher.cc » ('j') | components/safe_json/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698