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 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory)); | 180 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory)); |
181 source->AddBoolean("isInstantExtendedApiEnabled", | 181 source->AddBoolean("isInstantExtendedApiEnabled", |
182 chrome::IsInstantExtendedAPIEnabled()); | 182 chrome::IsInstantExtendedAPIEnabled()); |
183 | 183 |
184 source->SetJsonPath(kStringsJsFile); | 184 source->SetJsonPath(kStringsJsFile); |
185 source->AddResourcePath(kHistoryJsFile, IDR_HISTORY_JS); | 185 source->AddResourcePath(kHistoryJsFile, IDR_HISTORY_JS); |
186 source->AddResourcePath(kOtherDevicesJsFile, IDR_OTHER_DEVICES_JS); | 186 source->AddResourcePath(kOtherDevicesJsFile, IDR_OTHER_DEVICES_JS); |
187 source->SetDefaultResource(IDR_HISTORY_HTML); | 187 source->SetDefaultResource(IDR_HISTORY_HTML); |
188 source->SetUseJsonJSFormatV2(); | 188 source->SetUseJsonJSFormatV2(); |
189 source->DisableDenyXFrameOptions(); | 189 source->DisableDenyXFrameOptions(); |
190 source->AddBoolean("isManagedProfile", profile->IsSupervised()); | 190 source->AddBoolean("isSupervisedProfile", profile->IsSupervised()); |
191 source->AddBoolean("showDeleteVisitUI", !profile->IsSupervised()); | 191 source->AddBoolean("showDeleteVisitUI", !profile->IsSupervised()); |
192 | 192 |
193 return source; | 193 return source; |
194 } | 194 } |
195 | 195 |
196 // Returns a localized version of |visit_time| including a relative | 196 // Returns a localized version of |visit_time| including a relative |
197 // indicator (e.g. today, yesterday). | 197 // indicator (e.g. today, yesterday). |
198 base::string16 getRelativeDateLocalized(const base::Time& visit_time) { | 198 base::string16 getRelativeDateLocalized(const base::Time& visit_time) { |
199 base::Time midnight = base::Time::Now().LocalMidnight(); | 199 base::Time midnight = base::Time::Now().LocalMidnight(); |
200 base::string16 date_str = ui::TimeFormat::RelativeDate(visit_time, &midnight); | 200 base::string16 date_str = ui::TimeFormat::RelativeDate(visit_time, &midnight); |
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 Profile* profile = Profile::FromWebUI(web_ui); | 1005 Profile* profile = Profile::FromWebUI(web_ui); |
1006 content::WebUIDataSource::Add(profile, CreateHistoryUIHTMLSource(profile)); | 1006 content::WebUIDataSource::Add(profile, CreateHistoryUIHTMLSource(profile)); |
1007 } | 1007 } |
1008 | 1008 |
1009 // static | 1009 // static |
1010 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( | 1010 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( |
1011 ui::ScaleFactor scale_factor) { | 1011 ui::ScaleFactor scale_factor) { |
1012 return ResourceBundle::GetSharedInstance(). | 1012 return ResourceBundle::GetSharedInstance(). |
1013 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); | 1013 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); |
1014 } | 1014 } |
OLD | NEW |