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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 result->SetString("title", title_to_set); | 310 result->SetString("title", title_to_set); |
311 } | 311 } |
312 | 312 |
313 scoped_ptr<DictionaryValue> BrowsingHistoryHandler::HistoryEntry::ToValue( | 313 scoped_ptr<DictionaryValue> BrowsingHistoryHandler::HistoryEntry::ToValue( |
314 BookmarkModel* bookmark_model, | 314 BookmarkModel* bookmark_model, |
315 ManagedUserService* managed_user_service, | 315 ManagedUserService* managed_user_service, |
316 const ProfileSyncService* sync_service) const { | 316 const ProfileSyncService* sync_service) const { |
317 scoped_ptr<DictionaryValue> result(new DictionaryValue()); | 317 scoped_ptr<DictionaryValue> result(new DictionaryValue()); |
318 SetUrlAndTitle(result.get()); | 318 SetUrlAndTitle(result.get()); |
319 | 319 |
320 string16 domain = net::IDNToUnicode(url.host(), accept_languages); | 320 base::string16 domain = net::IDNToUnicode(url.host(), accept_languages); |
321 // When the domain is empty, use the scheme instead. This allows for a | 321 // When the domain is empty, use the scheme instead. This allows for a |
322 // sensible treatment of e.g. file: URLs when group by domain is on. | 322 // sensible treatment of e.g. file: URLs when group by domain is on. |
323 if (domain.empty()) | 323 if (domain.empty()) |
324 domain = UTF8ToUTF16(url.scheme() + ":"); | 324 domain = UTF8ToUTF16(url.scheme() + ":"); |
325 | 325 |
326 result->SetString("domain", domain); | 326 result->SetString("domain", domain); |
327 result->SetDouble("time", time.ToJsTime()); | 327 result->SetDouble("time", time.ToJsTime()); |
328 | 328 |
329 // Pass the timestamps in a list. | 329 // Pass the timestamps in a list. |
330 scoped_ptr<ListValue> timestamps(new ListValue); | 330 scoped_ptr<ListValue> timestamps(new ListValue); |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 return GURL(std::string(chrome::kChromeUIHistoryURL) + "#q=" + | 1003 return GURL(std::string(chrome::kChromeUIHistoryURL) + "#q=" + |
1004 net::EscapeQueryParamValue(UTF16ToUTF8(text), true)); | 1004 net::EscapeQueryParamValue(UTF16ToUTF8(text), true)); |
1005 } | 1005 } |
1006 | 1006 |
1007 // static | 1007 // static |
1008 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( | 1008 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( |
1009 ui::ScaleFactor scale_factor) { | 1009 ui::ScaleFactor scale_factor) { |
1010 return ResourceBundle::GetSharedInstance(). | 1010 return ResourceBundle::GetSharedInstance(). |
1011 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); | 1011 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); |
1012 } | 1012 } |
OLD | NEW |