| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 14 matching lines...) Expand all Loading... |
| 25 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
| 26 #include "chrome/browser/ui/browser.h" | 26 #include "chrome/browser/ui/browser.h" |
| 27 #include "chrome/browser/ui/browser_list.h" | 27 #include "chrome/browser/ui/browser_list.h" |
| 28 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" | 28 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" |
| 29 #include "chrome/browser/ui/webui/favicon_source.h" | 29 #include "chrome/browser/ui/webui/favicon_source.h" |
| 30 #include "chrome/common/chrome_notification_types.h" | 30 #include "chrome/common/chrome_notification_types.h" |
| 31 #include "chrome/common/time_format.h" | 31 #include "chrome/common/time_format.h" |
| 32 #include "chrome/common/url_constants.h" | 32 #include "chrome/common/url_constants.h" |
| 33 #include "content/browser/tab_contents/tab_contents.h" | 33 #include "content/browser/tab_contents/tab_contents.h" |
| 34 #include "content/browser/tab_contents/tab_contents_delegate.h" | 34 #include "content/browser/tab_contents/tab_contents_delegate.h" |
| 35 #include "content/browser/user_metrics.h" | |
| 36 #include "content/public/browser/notification_details.h" | 35 #include "content/public/browser/notification_details.h" |
| 37 #include "content/public/browser/notification_source.h" | 36 #include "content/public/browser/notification_source.h" |
| 37 #include "content/public/browser/user_metrics.h" |
| 38 #include "grit/browser_resources.h" | 38 #include "grit/browser_resources.h" |
| 39 #include "grit/chromium_strings.h" | 39 #include "grit/chromium_strings.h" |
| 40 #include "grit/generated_resources.h" | 40 #include "grit/generated_resources.h" |
| 41 #include "grit/locale_settings.h" | 41 #include "grit/locale_settings.h" |
| 42 #include "grit/theme_resources.h" | 42 #include "grit/theme_resources.h" |
| 43 #include "grit/theme_resources_standard.h" | 43 #include "grit/theme_resources_standard.h" |
| 44 #include "net/base/escape.h" | 44 #include "net/base/escape.h" |
| 45 #include "ui/base/l10n/l10n_util.h" | 45 #include "ui/base/l10n/l10n_util.h" |
| 46 #include "ui/base/resource/resource_bundle.h" | 46 #include "ui/base/resource/resource_bundle.h" |
| 47 | 47 |
| 48 using content::UserMetricsAction; |
| 49 |
| 48 // Maximum number of search results to return in a given search. We should | 50 // Maximum number of search results to return in a given search. We should |
| 49 // eventually remove this. | 51 // eventually remove this. |
| 50 static const int kMaxSearchResults = 100; | 52 static const int kMaxSearchResults = 100; |
| 51 static const char kStringsJsFile[] = "strings.js"; | 53 static const char kStringsJsFile[] = "strings.js"; |
| 52 static const char kHistoryJsFile[] = "history.js"; | 54 static const char kHistoryJsFile[] = "history.js"; |
| 53 | 55 |
| 54 //////////////////////////////////////////////////////////////////////////////// | 56 //////////////////////////////////////////////////////////////////////////////// |
| 55 // | 57 // |
| 56 // HistoryUIHTMLSource | 58 // HistoryUIHTMLSource |
| 57 // | 59 // |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 const GURL HistoryUI::GetHistoryURLWithSearchText(const string16& text) { | 435 const GURL HistoryUI::GetHistoryURLWithSearchText(const string16& text) { |
| 434 return GURL(std::string(chrome::kChromeUIHistoryURL) + "#q=" + | 436 return GURL(std::string(chrome::kChromeUIHistoryURL) + "#q=" + |
| 435 net::EscapeQueryParamValue(UTF16ToUTF8(text), true)); | 437 net::EscapeQueryParamValue(UTF16ToUTF8(text), true)); |
| 436 } | 438 } |
| 437 | 439 |
| 438 // static | 440 // static |
| 439 RefCountedMemory* HistoryUI::GetFaviconResourceBytes() { | 441 RefCountedMemory* HistoryUI::GetFaviconResourceBytes() { |
| 440 return ResourceBundle::GetSharedInstance(). | 442 return ResourceBundle::GetSharedInstance(). |
| 441 LoadDataResourceBytes(IDR_HISTORY_FAVICON); | 443 LoadDataResourceBytes(IDR_HISTORY_FAVICON); |
| 442 } | 444 } |
| OLD | NEW |