| 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 <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 switches::kHistoryEnableGroupByDomain)); | 180 switches::kHistoryEnableGroupByDomain)); |
| 181 source->AddBoolean("allowDeletingHistory", | 181 source->AddBoolean("allowDeletingHistory", |
| 182 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory)); | 182 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory)); |
| 183 source->AddBoolean("isInstantExtendedApiEnabled", | 183 source->AddBoolean("isInstantExtendedApiEnabled", |
| 184 chrome::IsInstantExtendedAPIEnabled()); | 184 chrome::IsInstantExtendedAPIEnabled()); |
| 185 | 185 |
| 186 source->SetJsonPath(kStringsJsFile); | 186 source->SetJsonPath(kStringsJsFile); |
| 187 source->AddResourcePath(kHistoryJsFile, IDR_HISTORY_JS); | 187 source->AddResourcePath(kHistoryJsFile, IDR_HISTORY_JS); |
| 188 source->AddResourcePath(kOtherDevicesJsFile, IDR_OTHER_DEVICES_JS); | 188 source->AddResourcePath(kOtherDevicesJsFile, IDR_OTHER_DEVICES_JS); |
| 189 source->SetDefaultResource(IDR_HISTORY_HTML); | 189 source->SetDefaultResource(IDR_HISTORY_HTML); |
| 190 source->SetUseJsonJSFormatV2(); | |
| 191 source->DisableDenyXFrameOptions(); | 190 source->DisableDenyXFrameOptions(); |
| 192 source->AddBoolean("isSupervisedProfile", profile->IsSupervised()); | 191 source->AddBoolean("isSupervisedProfile", profile->IsSupervised()); |
| 193 source->AddBoolean("showDeleteVisitUI", !profile->IsSupervised()); | 192 source->AddBoolean("showDeleteVisitUI", !profile->IsSupervised()); |
| 194 | 193 |
| 195 return source; | 194 return source; |
| 196 } | 195 } |
| 197 | 196 |
| 198 // Returns a localized version of |visit_time| including a relative | 197 // Returns a localized version of |visit_time| including a relative |
| 199 // indicator (e.g. today, yesterday). | 198 // indicator (e.g. today, yesterday). |
| 200 base::string16 getRelativeDateLocalized(const base::Time& visit_time) { | 199 base::string16 getRelativeDateLocalized(const base::Time& visit_time) { |
| (...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 Profile* profile = Profile::FromWebUI(web_ui); | 1016 Profile* profile = Profile::FromWebUI(web_ui); |
| 1018 content::WebUIDataSource::Add(profile, CreateHistoryUIHTMLSource(profile)); | 1017 content::WebUIDataSource::Add(profile, CreateHistoryUIHTMLSource(profile)); |
| 1019 } | 1018 } |
| 1020 | 1019 |
| 1021 // static | 1020 // static |
| 1022 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( | 1021 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( |
| 1023 ui::ScaleFactor scale_factor) { | 1022 ui::ScaleFactor scale_factor) { |
| 1024 return ResourceBundle::GetSharedInstance(). | 1023 return ResourceBundle::GetSharedInstance(). |
| 1025 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); | 1024 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); |
| 1026 } | 1025 } |
| OLD | NEW |