| OLD | NEW |
| 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/time.h" | 9 #include "base/time.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/policy/browser_policy_connector.h" | 12 #include "chrome/browser/policy/browser_policy_connector.h" |
| 13 #include "chrome/browser/policy/cloud_policy_cache_base.h" | 13 #include "chrome/browser/policy/cloud_policy_cache_base.h" |
| 14 #include "chrome/browser/policy/cloud_policy_data_store.h" | 14 #include "chrome/browser/policy/cloud_policy_data_store.h" |
| 15 #include "chrome/browser/prefs/pref_service.h" | 15 #include "chrome/browser/prefs/pref_service.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/ui/webui/chrome_url_data_manager_factory.h" |
| 17 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" | 18 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" |
| 18 #include "chrome/common/pref_names.h" | 19 #include "chrome/common/pref_names.h" |
| 19 #include "chrome/common/time_format.h" | 20 #include "chrome/common/time_format.h" |
| 20 #include "chrome/common/url_constants.h" | 21 #include "chrome/common/url_constants.h" |
| 21 #include "content/public/browser/web_contents.h" | 22 #include "content/public/browser/web_contents.h" |
| 22 #include "content/public/browser/web_ui.h" | 23 #include "content/public/browser/web_ui.h" |
| 23 #include "grit/browser_resources.h" | 24 #include "grit/browser_resources.h" |
| 24 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
| 25 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
| 26 | 27 |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 // | 233 // |
| 233 // PolicyUI | 234 // PolicyUI |
| 234 // | 235 // |
| 235 //////////////////////////////////////////////////////////////////////////////// | 236 //////////////////////////////////////////////////////////////////////////////// |
| 236 | 237 |
| 237 PolicyUI::PolicyUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 238 PolicyUI::PolicyUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
| 238 web_ui->AddMessageHandler(new PolicyUIHandler); | 239 web_ui->AddMessageHandler(new PolicyUIHandler); |
| 239 | 240 |
| 240 // Set up the chrome://policy/ source. | 241 // Set up the chrome://policy/ source. |
| 241 Profile* profile = Profile::FromWebUI(web_ui); | 242 Profile* profile = Profile::FromWebUI(web_ui); |
| 242 profile->GetChromeURLDataManager()->AddDataSource(CreatePolicyUIHTMLSource()); | 243 ChromeURLDataManagerFactory::GetForProfile(profile)-> |
| 244 AddDataSource(CreatePolicyUIHTMLSource()); |
| 243 } | 245 } |
| 244 | 246 |
| 245 PolicyUI::~PolicyUI() { | 247 PolicyUI::~PolicyUI() { |
| 246 } | 248 } |
| OLD | NEW |