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 29 matching lines...) Expand all Loading... |
40 #include "chrome/common/url_constants.h" | 40 #include "chrome/common/url_constants.h" |
41 #include "content/public/browser/browser_thread.h" | 41 #include "content/public/browser/browser_thread.h" |
42 #include "content/public/browser/download_item.h" | 42 #include "content/public/browser/download_item.h" |
43 #include "content/public/browser/url_data_source.h" | 43 #include "content/public/browser/url_data_source.h" |
44 #include "content/public/browser/user_metrics.h" | 44 #include "content/public/browser/user_metrics.h" |
45 #include "content/public/browser/web_contents.h" | 45 #include "content/public/browser/web_contents.h" |
46 #include "content/public/browser/web_contents_view.h" | 46 #include "content/public/browser/web_contents_view.h" |
47 #include "content/public/browser/web_ui.h" | 47 #include "content/public/browser/web_ui.h" |
48 #include "extensions/browser/extension_system.h" | 48 #include "extensions/browser/extension_system.h" |
49 #include "grit/generated_resources.h" | 49 #include "grit/generated_resources.h" |
50 #include "net/base/net_util.h" | 50 #include "net/base/filename_util.h" |
51 #include "ui/base/l10n/time_format.h" | 51 #include "ui/base/l10n/time_format.h" |
52 #include "ui/gfx/image/image.h" | 52 #include "ui/gfx/image/image.h" |
53 | 53 |
54 using base::UserMetricsAction; | 54 using base::UserMetricsAction; |
55 using content::BrowserContext; | 55 using content::BrowserContext; |
56 using content::BrowserThread; | 56 using content::BrowserThread; |
57 | 57 |
58 namespace { | 58 namespace { |
59 | 59 |
60 // Maximum number of downloads to show. TODO(glen): Remove this and instead | 60 // Maximum number of downloads to show. TODO(glen): Remove this and instead |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 } | 575 } |
576 | 576 |
577 void DownloadsDOMHandler::CallDownloadsList(const base::ListValue& downloads) { | 577 void DownloadsDOMHandler::CallDownloadsList(const base::ListValue& downloads) { |
578 web_ui()->CallJavascriptFunction("downloadsList", downloads); | 578 web_ui()->CallJavascriptFunction("downloadsList", downloads); |
579 } | 579 } |
580 | 580 |
581 void DownloadsDOMHandler::CallDownloadUpdated( | 581 void DownloadsDOMHandler::CallDownloadUpdated( |
582 const base::ListValue& download_item) { | 582 const base::ListValue& download_item) { |
583 web_ui()->CallJavascriptFunction("downloadUpdated", download_item); | 583 web_ui()->CallJavascriptFunction("downloadUpdated", download_item); |
584 } | 584 } |
OLD | NEW |