| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/dom_ui/history_ui.h" | 5 #include "chrome/browser/dom_ui/history_ui.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| 11 #include "app/resource_bundle.h" | |
| 12 #include "base/callback.h" | 11 #include "base/callback.h" |
| 13 #include "base/i18n/time_formatting.h" | 12 #include "base/i18n/time_formatting.h" |
| 14 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 15 #include "base/singleton.h" | 14 #include "base/singleton.h" |
| 16 #include "base/string16.h" | 15 #include "base/string16.h" |
| 17 #include "base/string_number_conversions.h" | 16 #include "base/string_number_conversions.h" |
| 18 #include "base/string_piece.h" | 17 #include "base/string_piece.h" |
| 19 #include "base/threading/thread.h" | 18 #include "base/threading/thread.h" |
| 20 #include "base/time.h" | 19 #include "base/time.h" |
| 21 #include "base/utf_string_conversions.h" | 20 #include "base/utf_string_conversions.h" |
| 22 #include "base/values.h" | 21 #include "base/values.h" |
| 23 #include "chrome/browser/bookmarks/bookmark_model.h" | 22 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 24 #include "chrome/browser/browser_thread.h" | 23 #include "chrome/browser/browser_thread.h" |
| 25 #include "chrome/browser/dom_ui/dom_ui_favicon_source.h" | 24 #include "chrome/browser/dom_ui/dom_ui_favicon_source.h" |
| 26 #include "chrome/browser/metrics/user_metrics.h" | 25 #include "chrome/browser/metrics/user_metrics.h" |
| 27 #include "chrome/browser/history/history_types.h" | 26 #include "chrome/browser/history/history_types.h" |
| 28 #include "chrome/browser/profiles/profile.h" | 27 #include "chrome/browser/profiles/profile.h" |
| 29 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 28 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
| 30 #include "chrome/browser/tab_contents/tab_contents.h" | 29 #include "chrome/browser/tab_contents/tab_contents.h" |
| 31 #include "chrome/browser/ui/browser.h" | 30 #include "chrome/browser/ui/browser.h" |
| 32 #include "chrome/browser/ui/browser_list.h" | 31 #include "chrome/browser/ui/browser_list.h" |
| 33 #include "chrome/common/jstemplate_builder.h" | 32 #include "chrome/common/jstemplate_builder.h" |
| 34 #include "chrome/common/notification_source.h" | 33 #include "chrome/common/notification_source.h" |
| 35 #include "chrome/common/time_format.h" | 34 #include "chrome/common/time_format.h" |
| 36 #include "chrome/common/url_constants.h" | 35 #include "chrome/common/url_constants.h" |
| 37 #include "net/base/escape.h" | |
| 38 | |
| 39 #include "grit/browser_resources.h" | 36 #include "grit/browser_resources.h" |
| 40 #include "grit/chromium_strings.h" | 37 #include "grit/chromium_strings.h" |
| 41 #include "grit/generated_resources.h" | 38 #include "grit/generated_resources.h" |
| 42 #include "grit/locale_settings.h" | 39 #include "grit/locale_settings.h" |
| 43 #include "grit/theme_resources.h" | 40 #include "grit/theme_resources.h" |
| 41 #include "net/base/escape.h" |
| 42 #include "ui/base/resource/resource_bundle.h" |
| 44 | 43 |
| 45 // Maximum number of search results to return in a given search. We should | 44 // Maximum number of search results to return in a given search. We should |
| 46 // eventually remove this. | 45 // eventually remove this. |
| 47 static const int kMaxSearchResults = 100; | 46 static const int kMaxSearchResults = 100; |
| 48 | 47 |
| 49 //////////////////////////////////////////////////////////////////////////////// | 48 //////////////////////////////////////////////////////////////////////////////// |
| 50 // | 49 // |
| 51 // HistoryHTMLSource | 50 // HistoryHTMLSource |
| 52 // | 51 // |
| 53 //////////////////////////////////////////////////////////////////////////////// | 52 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 const GURL HistoryUI::GetHistoryURLWithSearchText(const string16& text) { | 400 const GURL HistoryUI::GetHistoryURLWithSearchText(const string16& text) { |
| 402 return GURL(std::string(chrome::kChromeUIHistoryURL) + "#q=" + | 401 return GURL(std::string(chrome::kChromeUIHistoryURL) + "#q=" + |
| 403 EscapeQueryParamValue(UTF16ToUTF8(text), true)); | 402 EscapeQueryParamValue(UTF16ToUTF8(text), true)); |
| 404 } | 403 } |
| 405 | 404 |
| 406 // static | 405 // static |
| 407 RefCountedMemory* HistoryUI::GetFaviconResourceBytes() { | 406 RefCountedMemory* HistoryUI::GetFaviconResourceBytes() { |
| 408 return ResourceBundle::GetSharedInstance(). | 407 return ResourceBundle::GetSharedInstance(). |
| 409 LoadDataResourceBytes(IDR_HISTORY_FAVICON); | 408 LoadDataResourceBytes(IDR_HISTORY_FAVICON); |
| 410 } | 409 } |
| OLD | NEW |