| 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/history_ui.h" | 5 #include "chrome/browser/ui/webui/history_ui.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 search::IsInstantExtendedAPIEnabled()); | 162 search::IsInstantExtendedAPIEnabled()); |
| 163 source->AddBoolean("isSupervisedProfile", profile->IsSupervised()); | 163 source->AddBoolean("isSupervisedProfile", profile->IsSupervised()); |
| 164 source->AddBoolean("hideDeleteVisitUI", | 164 source->AddBoolean("hideDeleteVisitUI", |
| 165 profile->IsSupervised() && !allow_deleting_history); | 165 profile->IsSupervised() && !allow_deleting_history); |
| 166 | 166 |
| 167 source->SetJsonPath(kStringsJsFile); | 167 source->SetJsonPath(kStringsJsFile); |
| 168 source->AddResourcePath(kHistoryJsFile, IDR_HISTORY_JS); | 168 source->AddResourcePath(kHistoryJsFile, IDR_HISTORY_JS); |
| 169 source->AddResourcePath(kOtherDevicesJsFile, IDR_OTHER_DEVICES_JS); | 169 source->AddResourcePath(kOtherDevicesJsFile, IDR_OTHER_DEVICES_JS); |
| 170 source->SetDefaultResource(IDR_HISTORY_HTML); | 170 source->SetDefaultResource(IDR_HISTORY_HTML); |
| 171 source->DisableDenyXFrameOptions(); | 171 source->DisableDenyXFrameOptions(); |
| 172 source->DisableI18nAndUseGzipForAllPaths(); | 172 source->UseGzipForAllPaths(); |
| 173 | 173 |
| 174 return source; | 174 return source; |
| 175 } | 175 } |
| 176 | 176 |
| 177 } // namespace | 177 } // namespace |
| 178 | 178 |
| 179 HistoryUI::HistoryUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 179 HistoryUI::HistoryUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
| 180 // Set up the chrome://history-frame/ source. | 180 // Set up the chrome://history-frame/ source. |
| 181 Profile* profile = Profile::FromWebUI(web_ui); | 181 Profile* profile = Profile::FromWebUI(web_ui); |
| 182 content::WebUIDataSource::Add(profile, CreateHistoryUIHTMLSource(profile)); | 182 content::WebUIDataSource::Add(profile, CreateHistoryUIHTMLSource(profile)); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 } | 218 } |
| 219 | 219 |
| 220 void HistoryUI::UpdateDataSource() { | 220 void HistoryUI::UpdateDataSource() { |
| 221 CHECK(web_ui()); | 221 CHECK(web_ui()); |
| 222 Profile* profile = Profile::FromWebUI(web_ui()); | 222 Profile* profile = Profile::FromWebUI(web_ui()); |
| 223 std::unique_ptr<base::DictionaryValue> update(new base::DictionaryValue); | 223 std::unique_ptr<base::DictionaryValue> update(new base::DictionaryValue); |
| 224 update->SetBoolean(kIsUserSignedInKey, IsSignedIn(profile)); | 224 update->SetBoolean(kIsUserSignedInKey, IsSignedIn(profile)); |
| 225 content::WebUIDataSource::Update(profile, chrome::kChromeUIHistoryFrameHost, | 225 content::WebUIDataSource::Update(profile, chrome::kChromeUIHistoryFrameHost, |
| 226 std::move(update)); | 226 std::move(update)); |
| 227 } | 227 } |
| OLD | NEW |