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

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

Issue 6479007: Attempt 3 at: Splits ChromeURLDataManager into 2 chunks:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/slideshow_ui.h" 5 #include "chrome/browser/dom_ui/slideshow_ui.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/singleton.h" 10 #include "base/singleton.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 141 }
142 142
143 SlideshowHandler::~SlideshowHandler() { 143 SlideshowHandler::~SlideshowHandler() {
144 if (lister_.get()) { 144 if (lister_.get()) {
145 lister_->Cancel(); 145 lister_->Cancel();
146 lister_->set_delegate(NULL); 146 lister_->set_delegate(NULL);
147 } 147 }
148 } 148 }
149 149
150 WebUIMessageHandler* SlideshowHandler::Attach(DOMUI* dom_ui) { 150 WebUIMessageHandler* SlideshowHandler::Attach(DOMUI* dom_ui) {
151 profile_ = dom_ui->GetProfile();
151 // Create our favicon data source. 152 // Create our favicon data source.
152 BrowserThread::PostTask( 153 profile_->GetChromeURLDataManager()->AddDataSource(
153 BrowserThread::IO, FROM_HERE, 154 new WebUIFavIconSource(profile_));
154 NewRunnableMethod(
155 ChromeURLDataManager::GetInstance(),
156 &ChromeURLDataManager::AddDataSource,
157 make_scoped_refptr(new WebUIFavIconSource(dom_ui->GetProfile()))));
158 profile_ = dom_ui->GetProfile();
159 return WebUIMessageHandler::Attach(dom_ui); 155 return WebUIMessageHandler::Attach(dom_ui);
160 } 156 }
161 157
162 void SlideshowHandler::Init() { 158 void SlideshowHandler::Init() {
163 } 159 }
164 160
165 void SlideshowHandler::RegisterMessages() { 161 void SlideshowHandler::RegisterMessages() {
166 dom_ui_->RegisterMessageCallback("getChildren", 162 dom_ui_->RegisterMessageCallback("getChildren",
167 NewCallback(this, &SlideshowHandler::HandleGetChildren)); 163 NewCallback(this, &SlideshowHandler::HandleGetChildren));
168 dom_ui_->RegisterMessageCallback("refreshDirectory", 164 dom_ui_->RegisterMessageCallback("refreshDirectory",
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 // 273 //
278 //////////////////////////////////////////////////////////////////////////////// 274 ////////////////////////////////////////////////////////////////////////////////
279 275
280 SlideshowUI::SlideshowUI(TabContents* contents) : DOMUI(contents) { 276 SlideshowUI::SlideshowUI(TabContents* contents) : DOMUI(contents) {
281 SlideshowHandler* handler = new SlideshowHandler(); 277 SlideshowHandler* handler = new SlideshowHandler();
282 AddMessageHandler((handler)->Attach(this)); 278 AddMessageHandler((handler)->Attach(this));
283 handler->Init(); 279 handler->Init();
284 SlideshowUIHTMLSource* html_source = new SlideshowUIHTMLSource(); 280 SlideshowUIHTMLSource* html_source = new SlideshowUIHTMLSource();
285 281
286 // Set up the chrome://slideshow/ source. 282 // Set up the chrome://slideshow/ source.
287 BrowserThread::PostTask( 283 contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
288 BrowserThread::IO, FROM_HERE,
289 NewRunnableMethod(
290 ChromeURLDataManager::GetInstance(),
291 &ChromeURLDataManager::AddDataSource,
292 make_scoped_refptr(html_source)));
293 } 284 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698