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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" | 68 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" |
69 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" | 69 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" |
70 #endif | 70 #endif |
71 | 71 |
72 #if defined(OS_ANDROID) | 72 #if defined(OS_ANDROID) |
73 #include "chrome/browser/android/chromium_application.h" | 73 #include "chrome/browser/android/chromium_application.h" |
74 #endif | 74 #endif |
75 | 75 |
76 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 76 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
77 #include "chrome/browser/ui/webui/foreign_session_handler.h" | 77 #include "chrome/browser/ui/webui/foreign_session_handler.h" |
78 #include "chrome/browser/ui/webui/ntp/ntp_login_handler.h" | 78 #include "chrome/browser/ui/webui/history_login_handler.h" |
79 #endif | 79 #endif |
80 | 80 |
81 using bookmarks::BookmarkModel; | 81 using bookmarks::BookmarkModel; |
82 | 82 |
83 static const char kStringsJsFile[] = "strings.js"; | 83 static const char kStringsJsFile[] = "strings.js"; |
84 static const char kHistoryJsFile[] = "history.js"; | 84 static const char kHistoryJsFile[] = "history.js"; |
85 static const char kOtherDevicesJsFile[] = "other_devices.js"; | 85 static const char kOtherDevicesJsFile[] = "other_devices.js"; |
86 | 86 |
87 // The amount of time to wait for a response from the WebHistoryService. | 87 // The amount of time to wait for a response from the WebHistoryService. |
88 static const int kWebHistoryTimeoutSeconds = 3; | 88 static const int kWebHistoryTimeoutSeconds = 3; |
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1022 //////////////////////////////////////////////////////////////////////////////// | 1022 //////////////////////////////////////////////////////////////////////////////// |
1023 // | 1023 // |
1024 // HistoryUI | 1024 // HistoryUI |
1025 // | 1025 // |
1026 //////////////////////////////////////////////////////////////////////////////// | 1026 //////////////////////////////////////////////////////////////////////////////// |
1027 | 1027 |
1028 HistoryUI::HistoryUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 1028 HistoryUI::HistoryUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
1029 web_ui->AddMessageHandler(new BrowsingHistoryHandler()); | 1029 web_ui->AddMessageHandler(new BrowsingHistoryHandler()); |
1030 web_ui->AddMessageHandler(new MetricsHandler()); | 1030 web_ui->AddMessageHandler(new MetricsHandler()); |
1031 | 1031 |
1032 // On mobile we deal with foreign sessions differently. | 1032 // On mobile we deal with foreign sessions differently. |
1033 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 1033 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
1034 if (chrome::IsInstantExtendedAPIEnabled()) { | 1034 if (chrome::IsInstantExtendedAPIEnabled()) { |
1035 web_ui->AddMessageHandler(new browser_sync::ForeignSessionHandler()); | 1035 web_ui->AddMessageHandler(new browser_sync::ForeignSessionHandler()); |
1036 web_ui->AddMessageHandler(new NTPLoginHandler()); | 1036 web_ui->AddMessageHandler(new HistoryLoginHandler()); |
1037 } | 1037 } |
1038 #endif | 1038 #endif |
1039 | 1039 |
1040 // Set up the chrome://history-frame/ source. | 1040 // Set up the chrome://history-frame/ source. |
1041 Profile* profile = Profile::FromWebUI(web_ui); | 1041 Profile* profile = Profile::FromWebUI(web_ui); |
1042 content::WebUIDataSource::Add(profile, CreateHistoryUIHTMLSource(profile)); | 1042 content::WebUIDataSource::Add(profile, CreateHistoryUIHTMLSource(profile)); |
1043 } | 1043 } |
1044 | 1044 |
| 1045 HistoryUI::~HistoryUI() {} |
| 1046 |
1045 // static | 1047 // static |
1046 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( | 1048 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( |
1047 ui::ScaleFactor scale_factor) { | 1049 ui::ScaleFactor scale_factor) { |
1048 return ResourceBundle::GetSharedInstance(). | 1050 return ResourceBundle::GetSharedInstance(). |
1049 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); | 1051 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); |
1050 } | 1052 } |
OLD | NEW |