| 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/instant_ui.h" | 5 #include "chrome/browser/ui/webui/instant_ui.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/prefs/pref_service.h" | |
| 12 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 13 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 14 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
| 17 #include "chrome/browser/ui/browser_finder.h" | 16 #include "chrome/browser/ui/browser_finder.h" |
| 18 #include "chrome/browser/ui/browser_instant_controller.h" | 17 #include "chrome/browser/ui/browser_instant_controller.h" |
| 19 #include "chrome/browser/ui/search/instant_controller.h" | 18 #include "chrome/browser/ui/search/instant_controller.h" |
| 20 #include "chrome/common/pref_names.h" | 19 #include "chrome/common/pref_names.h" |
| 21 #include "chrome/common/url_constants.h" | 20 #include "chrome/common/url_constants.h" |
| 22 #include "components/pref_registry/pref_registry_syncable.h" | 21 #include "components/pref_registry/pref_registry_syncable.h" |
| 22 #include "components/prefs/pref_service.h" |
| 23 #include "content/public/browser/web_ui.h" | 23 #include "content/public/browser/web_ui.h" |
| 24 #include "content/public/browser/web_ui_data_source.h" | 24 #include "content/public/browser/web_ui_data_source.h" |
| 25 #include "content/public/browser/web_ui_message_handler.h" | 25 #include "content/public/browser/web_ui_message_handler.h" |
| 26 #include "grit/browser_resources.h" | 26 #include "grit/browser_resources.h" |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 content::WebUIDataSource* CreateInstantHTMLSource() { | 30 content::WebUIDataSource* CreateInstantHTMLSource() { |
| 31 content::WebUIDataSource* source = | 31 content::WebUIDataSource* source = |
| 32 content::WebUIDataSource::Create(chrome::kChromeUIInstantHost); | 32 content::WebUIDataSource::Create(chrome::kChromeUIInstantHost); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 Profile* profile = Profile::FromWebUI(web_ui); | 172 Profile* profile = Profile::FromWebUI(web_ui); |
| 173 content::WebUIDataSource::Add(profile, CreateInstantHTMLSource()); | 173 content::WebUIDataSource::Add(profile, CreateInstantHTMLSource()); |
| 174 } | 174 } |
| 175 | 175 |
| 176 // static | 176 // static |
| 177 void InstantUI::RegisterProfilePrefs( | 177 void InstantUI::RegisterProfilePrefs( |
| 178 user_prefs::PrefRegistrySyncable* registry) { | 178 user_prefs::PrefRegistrySyncable* registry) { |
| 179 registry->RegisterStringPref(prefs::kInstantUIZeroSuggestUrlPrefix, | 179 registry->RegisterStringPref(prefs::kInstantUIZeroSuggestUrlPrefix, |
| 180 std::string()); | 180 std::string()); |
| 181 } | 181 } |
| OLD | NEW |