Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: chrome/browser/dom_ui/downloads_dom_handler.h

Issue 131094: Add GetMessageHandlers to HtmlDialogUIDelegate to allow... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/dom_ui/dom_ui.cc ('k') | chrome/browser/dom_ui/downloads_dom_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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 #ifndef CHROME_BROWSER_DOM_UI_DOWNLOADS_DOM_HANDLER_H_ 5 #ifndef CHROME_BROWSER_DOM_UI_DOWNLOADS_DOM_HANDLER_H_
6 #define CHROME_BROWSER_DOM_UI_DOWNLOADS_DOM_HANDLER_H_ 6 #define CHROME_BROWSER_DOM_UI_DOWNLOADS_DOM_HANDLER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "chrome/browser/dom_ui/dom_ui.h" 10 #include "chrome/browser/dom_ui/dom_ui.h"
11 #include "chrome/browser/download/download_manager.h" 11 #include "chrome/browser/download/download_manager.h"
12 12
13 class DictionaryValue; 13 class DictionaryValue;
14 class Value; 14 class Value;
15 15
16 // The handler for Javascript messages related to the "downloads" view, 16 // The handler for Javascript messages related to the "downloads" view,
17 // also observes changes to the download manager. 17 // also observes changes to the download manager.
18 class DownloadsDOMHandler : public DOMMessageHandler, 18 class DownloadsDOMHandler : public DOMMessageHandler,
19 public DownloadManager::Observer, 19 public DownloadManager::Observer,
20 public DownloadItem::Observer { 20 public DownloadItem::Observer {
21 public: 21 public:
22 explicit DownloadsDOMHandler(DOMUI* dom_ui, DownloadManager* dlm); 22 explicit DownloadsDOMHandler(DownloadManager* dlm);
23 virtual ~DownloadsDOMHandler(); 23 virtual ~DownloadsDOMHandler();
24 24
25 void Init(); 25 void Init();
26 26
27 // DOMMessageHandler implementation.
28 virtual void RegisterMessages();
29
27 // DownloadItem::Observer interface 30 // DownloadItem::Observer interface
28 virtual void OnDownloadUpdated(DownloadItem* download); 31 virtual void OnDownloadUpdated(DownloadItem* download);
29 virtual void OnDownloadOpened(DownloadItem* download) { } 32 virtual void OnDownloadOpened(DownloadItem* download) { }
30 33
31 // DownloadManager::Observer interface 34 // DownloadManager::Observer interface
32 virtual void ModelChanged(); 35 virtual void ModelChanged();
33 virtual void SetDownloads(std::vector<DownloadItem*>& downloads); 36 virtual void SetDownloads(std::vector<DownloadItem*>& downloads);
34 37
35 // Callback for the "getDownloads" message. 38 // Callback for the "getDownloads" message.
36 void HandleGetDownloads(const Value* value); 39 void HandleGetDownloads(const Value* value);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // The current set of visible DownloadItems for this view received from the 93 // The current set of visible DownloadItems for this view received from the
91 // DownloadManager. DownloadManager owns the DownloadItems. The vector is 94 // DownloadManager. DownloadManager owns the DownloadItems. The vector is
92 // kept in order, sorted by ascending start time. 95 // kept in order, sorted by ascending start time.
93 typedef std::vector<DownloadItem*> OrderedDownloads; 96 typedef std::vector<DownloadItem*> OrderedDownloads;
94 OrderedDownloads download_items_; 97 OrderedDownloads download_items_;
95 98
96 DISALLOW_COPY_AND_ASSIGN(DownloadsDOMHandler); 99 DISALLOW_COPY_AND_ASSIGN(DownloadsDOMHandler);
97 }; 100 };
98 101
99 #endif // CHROME_BROWSER_DOM_UI_DOWNLOADS_DOM_HANDLER_H_ 102 #endif // CHROME_BROWSER_DOM_UI_DOWNLOADS_DOM_HANDLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/dom_ui.cc ('k') | chrome/browser/dom_ui/downloads_dom_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698