| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 source->AddLocalizedString("control_by_extension", | 84 source->AddLocalizedString("control_by_extension", |
| 85 IDS_DOWNLOAD_BY_EXTENSION); | 85 IDS_DOWNLOAD_BY_EXTENSION); |
| 86 | 86 |
| 87 PrefService* prefs = profile->GetPrefs(); | 87 PrefService* prefs = profile->GetPrefs(); |
| 88 source->AddBoolean("allow_deleting_history", | 88 source->AddBoolean("allow_deleting_history", |
| 89 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory) && | 89 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory) && |
| 90 !profile->IsSupervised()); | 90 !profile->IsSupervised()); |
| 91 | 91 |
| 92 source->SetJsonPath("strings.js"); | 92 source->SetJsonPath("strings.js"); |
| 93 source->AddResourcePath("downloads.css", IDR_DOWNLOADS_CSS); | 93 source->AddResourcePath("downloads.css", IDR_DOWNLOADS_CSS); |
| 94 source->AddResourcePath("downloads.js", IDR_DOWNLOADS_JS); | 94 source->AddResourcePath("item.js", IDR_DOWNLOAD_ITEM_JS); |
| 95 source->AddResourcePath("item_view.js", IDR_DOWNLOAD_ITEM_VIEW_JS); |
| 96 source->AddResourcePath("focus_row.js", IDR_DOWNLOAD_FOCUS_ROW_JS); |
| 97 source->AddResourcePath("manager.js", IDR_DOWNLOAD_MANAGER_JS); |
| 95 source->SetDefaultResource(IDR_DOWNLOADS_HTML); | 98 source->SetDefaultResource(IDR_DOWNLOADS_HTML); |
| 96 | 99 |
| 97 return source; | 100 return source; |
| 98 } | 101 } |
| 99 | 102 |
| 100 } // namespace | 103 } // namespace |
| 101 | 104 |
| 102 /////////////////////////////////////////////////////////////////////////////// | 105 /////////////////////////////////////////////////////////////////////////////// |
| 103 // | 106 // |
| 104 // DownloadsUI | 107 // DownloadsUI |
| (...skipping 15 matching lines...) Expand all Loading... |
| 120 content::URLDataSource::Add(profile, theme); | 123 content::URLDataSource::Add(profile, theme); |
| 121 #endif | 124 #endif |
| 122 } | 125 } |
| 123 | 126 |
| 124 // static | 127 // static |
| 125 base::RefCountedMemory* DownloadsUI::GetFaviconResourceBytes( | 128 base::RefCountedMemory* DownloadsUI::GetFaviconResourceBytes( |
| 126 ui::ScaleFactor scale_factor) { | 129 ui::ScaleFactor scale_factor) { |
| 127 return ResourceBundle::GetSharedInstance(). | 130 return ResourceBundle::GetSharedInstance(). |
| 128 LoadDataResourceBytesForScale(IDR_DOWNLOADS_FAVICON, scale_factor); | 131 LoadDataResourceBytesForScale(IDR_DOWNLOADS_FAVICON, scale_factor); |
| 129 } | 132 } |
| OLD | NEW |