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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(); | 190 source->SetUseJsonJSFormatV2(); |
191 source->DisableDenyXFrameOptions(); | 191 source->DisableDenyXFrameOptions(); |
192 source->AddBoolean("isManagedProfile", profile->IsSupervised()); | 192 source->AddBoolean("isSupervisedProfile", profile->IsSupervised()); |
193 source->AddBoolean("showDeleteVisitUI", !profile->IsSupervised()); | 193 source->AddBoolean("showDeleteVisitUI", !profile->IsSupervised()); |
194 | 194 |
195 return source; | 195 return source; |
196 } | 196 } |
197 | 197 |
198 // Returns a localized version of |visit_time| including a relative | 198 // Returns a localized version of |visit_time| including a relative |
199 // indicator (e.g. today, yesterday). | 199 // indicator (e.g. today, yesterday). |
200 base::string16 getRelativeDateLocalized(const base::Time& visit_time) { | 200 base::string16 getRelativeDateLocalized(const base::Time& visit_time) { |
201 base::Time midnight = base::Time::Now().LocalMidnight(); | 201 base::Time midnight = base::Time::Now().LocalMidnight(); |
202 base::string16 date_str = ui::TimeFormat::RelativeDate(visit_time, &midnight); | 202 base::string16 date_str = ui::TimeFormat::RelativeDate(visit_time, &midnight); |
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 Profile* profile = Profile::FromWebUI(web_ui); | 1007 Profile* profile = Profile::FromWebUI(web_ui); |
1008 content::WebUIDataSource::Add(profile, CreateHistoryUIHTMLSource(profile)); | 1008 content::WebUIDataSource::Add(profile, CreateHistoryUIHTMLSource(profile)); |
1009 } | 1009 } |
1010 | 1010 |
1011 // static | 1011 // static |
1012 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( | 1012 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( |
1013 ui::ScaleFactor scale_factor) { | 1013 ui::ScaleFactor scale_factor) { |
1014 return ResourceBundle::GetSharedInstance(). | 1014 return ResourceBundle::GetSharedInstance(). |
1015 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); | 1015 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); |
1016 } | 1016 } |
OLD | NEW |