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

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

Issue 342020: First of several patches to get rid of MessageLoop caching now that we have C... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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
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 #include "chrome/browser/dom_ui/downloads_ui.h" 5 #include "chrome/browser/dom_ui/downloads_ui.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/string_piece.h" 9 #include "base/string_piece.h"
10 #include "base/thread.h" 10 #include "base/thread.h"
11 #include "base/values.h" 11 #include "base/values.h"
12 #include "chrome/browser/browser_process.h" 12 #include "chrome/browser/chrome_thread.h"
13 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" 13 #include "chrome/browser/dom_ui/chrome_url_data_manager.h"
14 #include "chrome/browser/dom_ui/downloads_dom_handler.h" 14 #include "chrome/browser/dom_ui/downloads_dom_handler.h"
15 #include "chrome/browser/download/download_manager.h" 15 #include "chrome/browser/download/download_manager.h"
16 #include "chrome/browser/profile.h" 16 #include "chrome/browser/profile.h"
17 #include "chrome/common/jstemplate_builder.h" 17 #include "chrome/common/jstemplate_builder.h"
18 #include "chrome/common/url_constants.h" 18 #include "chrome/common/url_constants.h"
19 #include "grit/browser_resources.h" 19 #include "grit/browser_resources.h"
20 #include "grit/generated_resources.h" 20 #include "grit/generated_resources.h"
21 #include "grit/theme_resources.h" 21 #include "grit/theme_resources.h"
22 22
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 GetDownloadManager(); 125 GetDownloadManager();
126 126
127 DownloadsDOMHandler* handler = new DownloadsDOMHandler(dlm); 127 DownloadsDOMHandler* handler = new DownloadsDOMHandler(dlm);
128 AddMessageHandler(handler); 128 AddMessageHandler(handler);
129 handler->Attach(this); 129 handler->Attach(this);
130 handler->Init(); 130 handler->Init();
131 131
132 DownloadsUIHTMLSource* html_source = new DownloadsUIHTMLSource(); 132 DownloadsUIHTMLSource* html_source = new DownloadsUIHTMLSource();
133 133
134 // Set up the chrome://downloads/ source. 134 // Set up the chrome://downloads/ source.
135 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, 135 ChromeThread::PostTask(
136 ChromeThread::IO, FROM_HERE,
136 NewRunnableMethod(&chrome_url_data_manager, 137 NewRunnableMethod(&chrome_url_data_manager,
137 &ChromeURLDataManager::AddDataSource, 138 &ChromeURLDataManager::AddDataSource,
138 html_source)); 139 html_source));
139 } 140 }
140 141
141 // static 142 // static
142 RefCountedMemory* DownloadsUI::GetFaviconResourceBytes() { 143 RefCountedMemory* DownloadsUI::GetFaviconResourceBytes() {
143 return ResourceBundle::GetSharedInstance(). 144 return ResourceBundle::GetSharedInstance().
144 LoadImageResourceBytes(IDR_DOWNLOADS_FAVICON); 145 LoadImageResourceBytes(IDR_DOWNLOADS_FAVICON);
145 } 146 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698