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/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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 PrefService* prefs = profile->GetPrefs(); | 82 PrefService* prefs = profile->GetPrefs(); |
83 source->AddBoolean("allow_deleting_history", | 83 source->AddBoolean("allow_deleting_history", |
84 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory)); | 84 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory)); |
85 source->AddBoolean("show_delete_history", !profile->IsSupervised()); | 85 source->AddBoolean("show_delete_history", !profile->IsSupervised()); |
86 | 86 |
87 source->SetJsonPath("strings.js"); | 87 source->SetJsonPath("strings.js"); |
88 source->AddResourcePath("downloads.css", IDR_DOWNLOADS_CSS); | 88 source->AddResourcePath("downloads.css", IDR_DOWNLOADS_CSS); |
89 source->AddResourcePath("downloads.js", IDR_DOWNLOADS_JS); | 89 source->AddResourcePath("downloads.js", IDR_DOWNLOADS_JS); |
90 source->SetDefaultResource(IDR_DOWNLOADS_HTML); | 90 source->SetDefaultResource(IDR_DOWNLOADS_HTML); |
91 source->SetUseJsonJSFormatV2(); | |
92 | 91 |
93 return source; | 92 return source; |
94 } | 93 } |
95 | 94 |
96 } // namespace | 95 } // namespace |
97 | 96 |
98 /////////////////////////////////////////////////////////////////////////////// | 97 /////////////////////////////////////////////////////////////////////////////// |
99 // | 98 // |
100 // DownloadsUI | 99 // DownloadsUI |
101 // | 100 // |
(...skipping 14 matching lines...) Expand all Loading... |
116 content::URLDataSource::Add(profile, theme); | 115 content::URLDataSource::Add(profile, theme); |
117 #endif | 116 #endif |
118 } | 117 } |
119 | 118 |
120 // static | 119 // static |
121 base::RefCountedMemory* DownloadsUI::GetFaviconResourceBytes( | 120 base::RefCountedMemory* DownloadsUI::GetFaviconResourceBytes( |
122 ui::ScaleFactor scale_factor) { | 121 ui::ScaleFactor scale_factor) { |
123 return ResourceBundle::GetSharedInstance(). | 122 return ResourceBundle::GetSharedInstance(). |
124 LoadDataResourceBytesForScale(IDR_DOWNLOADS_FAVICON, scale_factor); | 123 LoadDataResourceBytesForScale(IDR_DOWNLOADS_FAVICON, scale_factor); |
125 } | 124 } |
OLD | NEW |