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

Unified Diff: chrome/browser/ui/webui/history_ui.cc

Issue 12769024: History: Fix console errors on Android, and add some iOS ifdefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/history_ui.cc
diff --git a/chrome/browser/ui/webui/history_ui.cc b/chrome/browser/ui/webui/history_ui.cc
index fc18ebabb398254c7e422c91f8e28783be3ea7ee..6c6e5bfc7e3ca3159665afec38267428814cdadf 100644
--- a/chrome/browser/ui/webui/history_ui.cc
+++ b/chrome/browser/ui/webui/history_ui.cc
@@ -57,7 +57,9 @@
#if defined(OS_ANDROID)
#include "chrome/browser/ui/android/tab_model/tab_model.h"
#include "chrome/browser/ui/android/tab_model/tab_model_list.h"
-#else
+#endif
+
+#if !defined(OS_ANDROID) && !defined(OS_IOS)
#include "chrome/browser/ui/webui/ntp/foreign_session_handler.h"
#include "chrome/browser/ui/webui/ntp/ntp_login_handler.h"
#endif
@@ -158,7 +160,9 @@ content::WebUIDataSource* CreateHistoryUIHTMLSource(Profile* profile) {
source->SetUseJsonJSFormatV2();
source->DisableDenyXFrameOptions();
-#if !defined(OS_ANDROID)
+#if defined(OS_ANDROID) || defined(OS_IOS)
+ source->AddBoolean("isManagedProfile", false);
+#else
source->AddBoolean("isManagedProfile",
ManagedUserServiceFactory::GetForProfile(profile)->ProfileIsManaged());
#endif
@@ -378,7 +382,7 @@ void BrowsingHistoryHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback("removeBookmark",
base::Bind(&BrowsingHistoryHandler::HandleRemoveBookmark,
base::Unretained(this)));
-#if !defined(OS_ANDROID)
+#if !defined(OS_ANDROID) && !defined(OS_IOS)
web_ui()->RegisterMessageCallback("processManagedUrls",
base::Bind(&BrowsingHistoryHandler::HandleProcessManagedUrls,
base::Unretained(this)));
@@ -589,7 +593,7 @@ void BrowsingHistoryHandler::HandleRemoveVisits(const ListValue* args) {
}
}
-#if !defined(OS_ANDROID)
+#if !defined(OS_ANDROID) && !defined(OS_IOS)
void BrowsingHistoryHandler::HandleProcessManagedUrls(const ListValue* args) {
bool allow = false;
if (!args->GetBoolean(0, &allow)) {
@@ -703,7 +707,7 @@ void BrowsingHistoryHandler::HandleProcessManagedUrls(const ListValue* args) {
// should update the page.
web_ui()->CallJavascriptFunction("updateEntries", results);
}
-#endif // defined(OS_ANDROID)
+#endif // !defined(OS_ANDROID) && !defined(OS_IOS)
void BrowsingHistoryHandler::HandleClearBrowsingData(const ListValue* args) {
#if defined(OS_ANDROID)
@@ -1091,13 +1095,13 @@ void BrowsingHistoryHandler::Observe(
HistoryUI::HistoryUI(content::WebUI* web_ui) : WebUIController(web_ui) {
web_ui->AddMessageHandler(new BrowsingHistoryHandler());
-// Android deals with foreign sessions differently.
-#if !defined(OS_ANDROID)
+// On mobile we deal with foreign sessions differently.
+#if !defined(OS_ANDROID) && !defined(OS_IOS)
if (chrome::search::IsInstantExtendedAPIEnabled()) {
web_ui->AddMessageHandler(new browser_sync::ForeignSessionHandler());
web_ui->AddMessageHandler(new NTPLoginHandler());
}
-#endif // !defined(OS_ANDROID)
+#endif
// Set up the chrome://history-frame/ source.
Profile* profile = Profile::FromWebUI(web_ui);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698