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

Side by Side Diff: chrome/browser/ui/webui/policy_ui.cc

Issue 349643002: Decoupled the SchemaRegistryService from SchemaRegistry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/webui/policy_ui.h" 5 #include "chrome/browser/ui/webui/policy_ui.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 const policy::PolicyMap& current) { 606 const policy::PolicyMap& current) {
607 SendPolicyValues(); 607 SendPolicyValues();
608 } 608 }
609 609
610 void PolicyUIHandler::SendPolicyNames() const { 610 void PolicyUIHandler::SendPolicyNames() const {
611 base::DictionaryValue names; 611 base::DictionaryValue names;
612 612
613 Profile* profile = Profile::FromWebUI(web_ui()); 613 Profile* profile = Profile::FromWebUI(web_ui());
614 policy::SchemaRegistry* registry = 614 policy::SchemaRegistry* registry =
615 policy::SchemaRegistryServiceFactory::GetForContext( 615 policy::SchemaRegistryServiceFactory::GetForContext(
616 profile->GetOriginalProfile()); 616 profile->GetOriginalProfile())->registry();
617 scoped_refptr<policy::SchemaMap> schema_map = registry->schema_map(); 617 scoped_refptr<policy::SchemaMap> schema_map = registry->schema_map();
618 618
619 // Add Chrome policy names. 619 // Add Chrome policy names.
620 base::DictionaryValue* chrome_policy_names = new base::DictionaryValue; 620 base::DictionaryValue* chrome_policy_names = new base::DictionaryValue;
621 policy::PolicyNamespace chrome_ns(policy::POLICY_DOMAIN_CHROME, ""); 621 policy::PolicyNamespace chrome_ns(policy::POLICY_DOMAIN_CHROME, "");
622 const policy::Schema* chrome_schema = schema_map->GetSchema(chrome_ns); 622 const policy::Schema* chrome_schema = schema_map->GetSchema(chrome_ns);
623 for (policy::Schema::Iterator it = chrome_schema->GetPropertiesIterator(); 623 for (policy::Schema::Iterator it = chrome_schema->GetPropertiesIterator();
624 !it.IsAtEnd(); it.Advance()) { 624 !it.IsAtEnd(); it.Advance()) {
625 chrome_policy_names->SetBoolean(it.key(), true); 625 chrome_policy_names->SetBoolean(it.key(), true);
626 } 626 }
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 } 788 }
789 789
790 PolicyUI::PolicyUI(content::WebUI* web_ui) : WebUIController(web_ui) { 790 PolicyUI::PolicyUI(content::WebUI* web_ui) : WebUIController(web_ui) {
791 web_ui->AddMessageHandler(new PolicyUIHandler); 791 web_ui->AddMessageHandler(new PolicyUIHandler);
792 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), 792 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui),
793 CreatePolicyUIHTMLSource()); 793 CreatePolicyUIHTMLSource());
794 } 794 }
795 795
796 PolicyUI::~PolicyUI() { 796 PolicyUI::~PolicyUI() {
797 } 797 }
OLDNEW
« no previous file with comments | « chrome/browser/policy/schema_registry_service_factory.cc ('k') | components/policy/core/common/schema_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698