OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 lister_->Cancel(); | 146 lister_->Cancel(); |
147 lister_->set_delegate(NULL); | 147 lister_->set_delegate(NULL); |
148 } | 148 } |
149 } | 149 } |
150 | 150 |
151 DOMMessageHandler* SlideshowHandler::Attach(DOMUI* dom_ui) { | 151 DOMMessageHandler* SlideshowHandler::Attach(DOMUI* dom_ui) { |
152 // Create our favicon data source. | 152 // Create our favicon data source. |
153 BrowserThread::PostTask( | 153 BrowserThread::PostTask( |
154 BrowserThread::IO, FROM_HERE, | 154 BrowserThread::IO, FROM_HERE, |
155 NewRunnableMethod( | 155 NewRunnableMethod( |
156 Singleton<ChromeURLDataManager>::get(), | 156 ChromeURLDataManager::GetInstance(), |
157 &ChromeURLDataManager::AddDataSource, | 157 &ChromeURLDataManager::AddDataSource, |
158 make_scoped_refptr(new DOMUIFavIconSource(dom_ui->GetProfile())))); | 158 make_scoped_refptr(new DOMUIFavIconSource(dom_ui->GetProfile())))); |
159 profile_ = dom_ui->GetProfile(); | 159 profile_ = dom_ui->GetProfile(); |
160 return DOMMessageHandler::Attach(dom_ui); | 160 return DOMMessageHandler::Attach(dom_ui); |
161 } | 161 } |
162 | 162 |
163 void SlideshowHandler::Init() { | 163 void SlideshowHandler::Init() { |
164 } | 164 } |
165 | 165 |
166 void SlideshowHandler::RegisterMessages() { | 166 void SlideshowHandler::RegisterMessages() { |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 SlideshowUI::SlideshowUI(TabContents* contents) : DOMUI(contents) { | 281 SlideshowUI::SlideshowUI(TabContents* contents) : DOMUI(contents) { |
282 SlideshowHandler* handler = new SlideshowHandler(); | 282 SlideshowHandler* handler = new SlideshowHandler(); |
283 AddMessageHandler((handler)->Attach(this)); | 283 AddMessageHandler((handler)->Attach(this)); |
284 handler->Init(); | 284 handler->Init(); |
285 SlideshowUIHTMLSource* html_source = new SlideshowUIHTMLSource(); | 285 SlideshowUIHTMLSource* html_source = new SlideshowUIHTMLSource(); |
286 | 286 |
287 // Set up the chrome://slideshow/ source. | 287 // Set up the chrome://slideshow/ source. |
288 BrowserThread::PostTask( | 288 BrowserThread::PostTask( |
289 BrowserThread::IO, FROM_HERE, | 289 BrowserThread::IO, FROM_HERE, |
290 NewRunnableMethod( | 290 NewRunnableMethod( |
291 Singleton<ChromeURLDataManager>::get(), | 291 ChromeURLDataManager::GetInstance(), |
292 &ChromeURLDataManager::AddDataSource, | 292 &ChromeURLDataManager::AddDataSource, |
293 make_scoped_refptr(html_source))); | 293 make_scoped_refptr(html_source))); |
294 } | 294 } |
OLD | NEW |