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

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

Issue 957253003: Fix chrome://history for supervised users on mobile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 5 years, 10 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/resources/history/history_mobile.css ('k') | no next file » | 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 source->AddLocalizedString("hasSyncedResults", 184 source->AddLocalizedString("hasSyncedResults",
185 IDS_HISTORY_HAS_SYNCED_RESULTS); 185 IDS_HISTORY_HAS_SYNCED_RESULTS);
186 source->AddLocalizedString("noSyncedResults", IDS_HISTORY_NO_SYNCED_RESULTS); 186 source->AddLocalizedString("noSyncedResults", IDS_HISTORY_NO_SYNCED_RESULTS);
187 source->AddLocalizedString("cancel", IDS_CANCEL); 187 source->AddLocalizedString("cancel", IDS_CANCEL);
188 source->AddLocalizedString("deleteConfirm", 188 source->AddLocalizedString("deleteConfirm",
189 IDS_HISTORY_DELETE_PRIOR_VISITS_CONFIRM_BUTTON); 189 IDS_HISTORY_DELETE_PRIOR_VISITS_CONFIRM_BUTTON);
190 source->AddLocalizedString("bookmarked", IDS_HISTORY_ENTRY_BOOKMARKED); 190 source->AddLocalizedString("bookmarked", IDS_HISTORY_ENTRY_BOOKMARKED);
191 source->AddLocalizedString("entrySummary", IDS_HISTORY_ENTRY_SUMMARY); 191 source->AddLocalizedString("entrySummary", IDS_HISTORY_ENTRY_SUMMARY);
192 source->AddBoolean("isFullHistorySyncEnabled", 192 source->AddBoolean("isFullHistorySyncEnabled",
193 WebHistoryServiceFactory::GetForProfile(profile) != NULL); 193 WebHistoryServiceFactory::GetForProfile(profile) != NULL);
194 source->AddBoolean("groupByDomain", 194 bool group_by_domain = base::CommandLine::ForCurrentProcess()->HasSwitch(
195 profile->IsSupervised() || 195 switches::kHistoryEnableGroupByDomain);
196 base::CommandLine::ForCurrentProcess()->HasSwitch( 196 // Supervised users get the "group by domain" version, but not on mobile,
197 switches::kHistoryEnableGroupByDomain)); 197 // because that version isn't adjusted for small screens yet. crbug.com/452859
198 #if !defined(OS_ANDROID) && !defined(OS_IOS)
199 group_by_domain = group_by_domain || profile->IsSupervised();
200 #endif
201 source->AddBoolean("groupByDomain", group_by_domain);
198 bool allow_deleting_history = 202 bool allow_deleting_history =
199 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory); 203 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory);
200 source->AddBoolean("allowDeletingHistory", allow_deleting_history); 204 source->AddBoolean("allowDeletingHistory", allow_deleting_history);
201 source->AddBoolean("isInstantExtendedApiEnabled", 205 source->AddBoolean("isInstantExtendedApiEnabled",
202 chrome::IsInstantExtendedAPIEnabled()); 206 chrome::IsInstantExtendedAPIEnabled());
203 source->AddBoolean("isSupervisedProfile", profile->IsSupervised()); 207 source->AddBoolean("isSupervisedProfile", profile->IsSupervised());
204 source->AddBoolean("hideDeleteVisitUI", 208 source->AddBoolean("hideDeleteVisitUI",
205 profile->IsSupervised() && !allow_deleting_history); 209 profile->IsSupervised() && !allow_deleting_history);
206 210
207 source->SetJsonPath(kStringsJsFile); 211 source->SetJsonPath(kStringsJsFile);
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 Profile* profile = Profile::FromWebUI(web_ui); 1039 Profile* profile = Profile::FromWebUI(web_ui);
1036 content::WebUIDataSource::Add(profile, CreateHistoryUIHTMLSource(profile)); 1040 content::WebUIDataSource::Add(profile, CreateHistoryUIHTMLSource(profile));
1037 } 1041 }
1038 1042
1039 // static 1043 // static
1040 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( 1044 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes(
1041 ui::ScaleFactor scale_factor) { 1045 ui::ScaleFactor scale_factor) {
1042 return ResourceBundle::GetSharedInstance(). 1046 return ResourceBundle::GetSharedInstance().
1043 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); 1047 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor);
1044 } 1048 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/history/history_mobile.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698