Chromium Code Reviews| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 | 57 |
| 58 using base::UserMetricsAction; | 58 using base::UserMetricsAction; |
| 59 using content::BrowserContext; | 59 using content::BrowserContext; |
| 60 using content::BrowserThread; | 60 using content::BrowserThread; |
| 61 | 61 |
| 62 namespace { | 62 namespace { |
| 63 | 63 |
| 64 // Maximum number of downloads to show. TODO(glen): Remove this and instead | 64 // Maximum number of downloads to show. TODO(glen): Remove this and instead |
| 65 // stuff the downloads down the pipe slowly. | 65 // stuff the downloads down the pipe slowly. |
| 66 size_t MaxNumberOfDownloads() { | 66 size_t MaxNumberOfDownloads() { |
| 67 return MdDownloadsEnabled() ? 50 : 150; | 67 return MdDownloadsEnabled() ? 300 : 150; |
|
esprehn
2015/10/03 05:11:54
woah!
Dan Beam
2015/10/04 08:27:08
Acknowledged.
| |
| 68 } | 68 } |
| 69 | 69 |
| 70 enum DownloadsDOMEvent { | 70 enum DownloadsDOMEvent { |
| 71 DOWNLOADS_DOM_EVENT_GET_DOWNLOADS = 0, | 71 DOWNLOADS_DOM_EVENT_GET_DOWNLOADS = 0, |
| 72 DOWNLOADS_DOM_EVENT_OPEN_FILE = 1, | 72 DOWNLOADS_DOM_EVENT_OPEN_FILE = 1, |
| 73 DOWNLOADS_DOM_EVENT_DRAG = 2, | 73 DOWNLOADS_DOM_EVENT_DRAG = 2, |
| 74 DOWNLOADS_DOM_EVENT_SAVE_DANGEROUS = 3, | 74 DOWNLOADS_DOM_EVENT_SAVE_DANGEROUS = 3, |
| 75 DOWNLOADS_DOM_EVENT_DISCARD_DANGEROUS = 4, | 75 DOWNLOADS_DOM_EVENT_DISCARD_DANGEROUS = 4, |
| 76 DOWNLOADS_DOM_EVENT_SHOW = 5, | 76 DOWNLOADS_DOM_EVENT_SHOW = 5, |
| 77 DOWNLOADS_DOM_EVENT_PAUSE = 6, | 77 DOWNLOADS_DOM_EVENT_PAUSE = 6, |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 730 return web_ui()->GetWebContents(); | 730 return web_ui()->GetWebContents(); |
| 731 } | 731 } |
| 732 | 732 |
| 733 void DownloadsDOMHandler::CallUpdateAll(const base::ListValue& list) { | 733 void DownloadsDOMHandler::CallUpdateAll(const base::ListValue& list) { |
| 734 web_ui()->CallJavascriptFunction("downloads.Manager.updateAll", list); | 734 web_ui()->CallJavascriptFunction("downloads.Manager.updateAll", list); |
| 735 } | 735 } |
| 736 | 736 |
| 737 void DownloadsDOMHandler::CallUpdateItem(const base::DictionaryValue& item) { | 737 void DownloadsDOMHandler::CallUpdateItem(const base::DictionaryValue& item) { |
| 738 web_ui()->CallJavascriptFunction("downloads.Manager.updateItem", item); | 738 web_ui()->CallJavascriptFunction("downloads.Manager.updateItem", item); |
| 739 } | 739 } |
| OLD | NEW |