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

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

Issue 6122006: Cleanup: Remove unneeded includes of pref_names.h (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/extension_host.cc ('k') | chrome/browser/first_run/first_run_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/external_policy_extension_provider.h" 5 #include "chrome/browser/extensions/external_policy_extension_provider.h"
6 6
7 #include <string>
8
7 #include "base/logging.h" 9 #include "base/logging.h"
8 #include "base/values.h" 10 #include "base/values.h"
9 #include "chrome/common/pref_names.h"
10 #include "chrome/browser/browser_thread.h" 11 #include "chrome/browser/browser_thread.h"
11 #include "chrome/browser/extensions/stateful_external_extension_provider.h" 12 #include "chrome/browser/extensions/stateful_external_extension_provider.h"
12 #include "chrome/browser/prefs/pref_service.h" 13 #include "chrome/browser/prefs/pref_service.h"
13 14
14 namespace { 15 namespace {
15 16
16 // Check an extension ID and an URL to be syntactically correct. 17 // Check an extension ID and an URL to be syntactically correct.
17 bool CheckExtension(std::string id, std::string update_url) { 18 bool CheckExtension(std::string id, std::string update_url) {
18 GURL url(update_url); 19 GURL url(update_url);
19 if (!url.is_valid()) { 20 if (!url.is_valid()) {
20 LOG(WARNING) << "Policy specifies invalid update URL for external " 21 LOG(WARNING) << "Policy specifies invalid update URL for external "
21 << "extension: " << update_url; 22 << "extension: " << update_url;
22 return false; 23 return false;
23 } 24 }
24 if (!Extension::IdIsValid(id)) { 25 if (!Extension::IdIsValid(id)) {
25 LOG(WARNING) << "Policy specifies invalid ID for external " 26 LOG(WARNING) << "Policy specifies invalid ID for external "
26 << "extension: " << id; 27 << "extension: " << id;
27 return false; 28 return false;
28 } 29 }
29 return true; 30 return true;
30 } 31 }
31 32
32 } 33 } // namespace
33 34
34 ExternalPolicyExtensionProvider::ExternalPolicyExtensionProvider( 35 ExternalPolicyExtensionProvider::ExternalPolicyExtensionProvider(
35 const ListValue* forcelist) 36 const ListValue* forcelist)
36 : StatefulExternalExtensionProvider( 37 : StatefulExternalExtensionProvider(
37 Extension::INVALID, 38 Extension::INVALID,
38 Extension::EXTERNAL_POLICY_DOWNLOAD) { 39 Extension::EXTERNAL_POLICY_DOWNLOAD) {
39 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 40 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
40 ProcessPreferences(forcelist); 41 ProcessPreferences(forcelist);
41 } 42 }
42 43
(...skipping 24 matching lines...) Expand all
67 std::string id = extension_desc.substr(0, pos); 68 std::string id = extension_desc.substr(0, pos);
68 std::string update_url = extension_desc.substr(pos+1); 69 std::string update_url = extension_desc.substr(pos+1);
69 if (CheckExtension(id, update_url)) { 70 if (CheckExtension(id, update_url)) {
70 result->SetString(id + ".external_update_url", update_url); 71 result->SetString(id + ".external_update_url", update_url);
71 } 72 }
72 } 73 }
73 } 74 }
74 } 75 }
75 set_prefs(result); 76 set_prefs(result);
76 } 77 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_host.cc ('k') | chrome/browser/first_run/first_run_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698