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

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

Issue 23851007: Hide the "downloads" page policy disabled UI elements from supervised users (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment nit Created 7 years, 3 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
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/downloads_ui.h" 5 #include "chrome/browser/ui/webui/downloads_ui.h"
6 6
7 #include "base/memory/ref_counted_memory.h" 7 #include "base/memory/ref_counted_memory.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/string_piece.h" 10 #include "base/strings/string_piece.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 source->AddLocalizedString("control_cancel", IDS_DOWNLOAD_LINK_CANCEL); 74 source->AddLocalizedString("control_cancel", IDS_DOWNLOAD_LINK_CANCEL);
75 source->AddLocalizedString("control_resume", IDS_DOWNLOAD_LINK_RESUME); 75 source->AddLocalizedString("control_resume", IDS_DOWNLOAD_LINK_RESUME);
76 source->AddLocalizedString("control_removefromlist", 76 source->AddLocalizedString("control_removefromlist",
77 IDS_DOWNLOAD_LINK_REMOVE); 77 IDS_DOWNLOAD_LINK_REMOVE);
78 source->AddLocalizedString("control_by_extension", 78 source->AddLocalizedString("control_by_extension",
79 IDS_DOWNLOAD_BY_EXTENSION); 79 IDS_DOWNLOAD_BY_EXTENSION);
80 80
81 PrefService* prefs = profile->GetPrefs(); 81 PrefService* prefs = profile->GetPrefs();
82 source->AddBoolean("allow_deleting_history", 82 source->AddBoolean("allow_deleting_history",
83 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory)); 83 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory));
84 source->AddBoolean("show_delete_history", !profile->IsManaged());
84 85
85 source->SetJsonPath("strings.js"); 86 source->SetJsonPath("strings.js");
86 source->AddResourcePath("downloads.css", IDR_DOWNLOADS_CSS); 87 source->AddResourcePath("downloads.css", IDR_DOWNLOADS_CSS);
87 source->AddResourcePath("downloads.js", IDR_DOWNLOADS_JS); 88 source->AddResourcePath("downloads.js", IDR_DOWNLOADS_JS);
88 source->SetDefaultResource(IDR_DOWNLOADS_HTML); 89 source->SetDefaultResource(IDR_DOWNLOADS_HTML);
89 source->SetUseJsonJSFormatV2(); 90 source->SetUseJsonJSFormatV2();
90 91
91 return source; 92 return source;
92 } 93 }
93 94
(...skipping 20 matching lines...) Expand all
114 content::URLDataSource::Add(profile, theme); 115 content::URLDataSource::Add(profile, theme);
115 #endif 116 #endif
116 } 117 }
117 118
118 // static 119 // static
119 base::RefCountedMemory* DownloadsUI::GetFaviconResourceBytes( 120 base::RefCountedMemory* DownloadsUI::GetFaviconResourceBytes(
120 ui::ScaleFactor scale_factor) { 121 ui::ScaleFactor scale_factor) {
121 return ResourceBundle::GetSharedInstance(). 122 return ResourceBundle::GetSharedInstance().
122 LoadDataResourceBytesForScale(IDR_DOWNLOADS_FAVICON, scale_factor); 123 LoadDataResourceBytesForScale(IDR_DOWNLOADS_FAVICON, scale_factor);
123 } 124 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/downloads/downloads.js ('k') | chrome/browser/ui/webui/downloads_ui_browsertest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698