Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: chrome/browser/ui/webui/history_ui.cc

Issue 1143963002: Split NTPLoginHandler across chrome://apps and chrome://history. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gyp fixes Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/webui/history_ui.h ('k') | chrome/browser/ui/webui/ntp/new_tab_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/history_ui.h ('k') | chrome/browser/ui/webui/ntp/new_tab_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698