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

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

Issue 5519016: Add a new GetInstance() method for singleton classes used in chrome/browser files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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/conflicts_ui.cc ('k') | chrome/browser/dom_ui/downloads_ui.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "chrome/browser/dom_ui/downloads_dom_handler.h" 5 #include "chrome/browser/dom_ui/downloads_dom_handler.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/singleton.h" 9 #include "base/singleton.h"
10 #include "base/string_piece.h" 10 #include "base/string_piece.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 } // namespace 45 } // namespace
46 46
47 DownloadsDOMHandler::DownloadsDOMHandler(DownloadManager* dlm) 47 DownloadsDOMHandler::DownloadsDOMHandler(DownloadManager* dlm)
48 : search_text_(), 48 : search_text_(),
49 download_manager_(dlm), 49 download_manager_(dlm),
50 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { 50 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
51 // Create our fileicon data source. 51 // Create our fileicon data source.
52 BrowserThread::PostTask( 52 BrowserThread::PostTask(
53 BrowserThread::IO, FROM_HERE, 53 BrowserThread::IO, FROM_HERE,
54 NewRunnableMethod( 54 NewRunnableMethod(
55 Singleton<ChromeURLDataManager>::get(), 55 ChromeURLDataManager::GetInstance(),
56 &ChromeURLDataManager::AddDataSource, 56 &ChromeURLDataManager::AddDataSource,
57 make_scoped_refptr(new FileIconSource()))); 57 make_scoped_refptr(new FileIconSource())));
58 } 58 }
59 59
60 DownloadsDOMHandler::~DownloadsDOMHandler() { 60 DownloadsDOMHandler::~DownloadsDOMHandler() {
61 ClearDownloadItems(); 61 ClearDownloadItems();
62 download_manager_->RemoveObserver(this); 62 download_manager_->RemoveObserver(this);
63 } 63 }
64 64
65 // DownloadsDOMHandler, public: ----------------------------------------------- 65 // DownloadsDOMHandler, public: -----------------------------------------------
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 return NULL; 241 return NULL;
242 } 242 }
243 243
244 DownloadItem* DownloadsDOMHandler::GetDownloadByValue(const ListValue* args) { 244 DownloadItem* DownloadsDOMHandler::GetDownloadByValue(const ListValue* args) {
245 int id; 245 int id;
246 if (ExtractIntegerValue(args, &id)) { 246 if (ExtractIntegerValue(args, &id)) {
247 return GetDownloadById(id); 247 return GetDownloadById(id);
248 } 248 }
249 return NULL; 249 return NULL;
250 } 250 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/conflicts_ui.cc ('k') | chrome/browser/dom_ui/downloads_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698