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_dom_handler.h" | 5 #include "chrome/browser/ui/webui/downloads_dom_handler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 DownloadsDOMHandler::DownloadsDOMHandler(content::DownloadManager* dlm) | 207 DownloadsDOMHandler::DownloadsDOMHandler(content::DownloadManager* dlm) |
208 : search_text_(), | 208 : search_text_(), |
209 ALLOW_THIS_IN_INITIALIZER_LIST(main_notifier_(dlm, this)), | 209 ALLOW_THIS_IN_INITIALIZER_LIST(main_notifier_(dlm, this)), |
210 update_scheduled_(false), | 210 update_scheduled_(false), |
211 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { | 211 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { |
212 // Create our fileicon data source. | 212 // Create our fileicon data source. |
213 Profile* profile = Profile::FromBrowserContext(dlm->GetBrowserContext()); | 213 Profile* profile = Profile::FromBrowserContext(dlm->GetBrowserContext()); |
214 ChromeURLDataManager::AddDataSource(profile, new FileIconSource()); | 214 ChromeURLDataManager::AddDataSource(profile, new FileIconSource()); |
215 | 215 |
216 if (profile->IsOffTheRecord()) { | 216 if (profile->IsOffTheRecord()) { |
217 original_notifier_.reset(new HyperbolicDownloadItemNotifier( | 217 original_notifier_.reset(new AllDownloadItemNotifier( |
218 BrowserContext::GetDownloadManager(profile->GetOriginalProfile()), | 218 BrowserContext::GetDownloadManager(profile->GetOriginalProfile()), |
219 this)); | 219 this)); |
220 } | 220 } |
221 } | 221 } |
222 | 222 |
223 DownloadsDOMHandler::~DownloadsDOMHandler() { | 223 DownloadsDOMHandler::~DownloadsDOMHandler() { |
224 } | 224 } |
225 | 225 |
226 // DownloadsDOMHandler, public: ----------------------------------------------- | 226 // DownloadsDOMHandler, public: ----------------------------------------------- |
227 | 227 |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 } | 501 } |
502 | 502 |
503 void DownloadsDOMHandler::CallDownloadsList(const base::ListValue& downloads) { | 503 void DownloadsDOMHandler::CallDownloadsList(const base::ListValue& downloads) { |
504 web_ui()->CallJavascriptFunction("downloadsList", downloads); | 504 web_ui()->CallJavascriptFunction("downloadsList", downloads); |
505 } | 505 } |
506 | 506 |
507 void DownloadsDOMHandler::CallDownloadUpdated( | 507 void DownloadsDOMHandler::CallDownloadUpdated( |
508 const base::ListValue& download_item) { | 508 const base::ListValue& download_item) { |
509 web_ui()->CallJavascriptFunction("downloadUpdated", download_item); | 509 web_ui()->CallJavascriptFunction("downloadUpdated", download_item); |
510 } | 510 } |
OLD | NEW |