OLD | NEW |
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/ui/webui/slideshow_ui.h" | 5 #include "chrome/browser/ui/webui/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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(WebUI* web_ui) { | 150 WebUIMessageHandler* SlideshowHandler::Attach(WebUI* web_ui) { |
151 profile_ = web_ui->GetProfile(); | 151 profile_ = web_ui->GetProfile(); |
152 // Create our favicon data source. | 152 // Create our favicon data source. |
153 profile_->GetChromeURLDataManager()->AddDataSource( | 153 profile_->GetChromeURLDataManager()->AddDataSource( |
154 new FaviconSource(profile_)); | 154 new FaviconSource(profile_, chrome::kChromeUIFaviconHost)); |
155 return WebUIMessageHandler::Attach(web_ui); | 155 return WebUIMessageHandler::Attach(web_ui); |
156 } | 156 } |
157 | 157 |
158 void SlideshowHandler::Init() { | 158 void SlideshowHandler::Init() { |
159 } | 159 } |
160 | 160 |
161 void SlideshowHandler::RegisterMessages() { | 161 void SlideshowHandler::RegisterMessages() { |
162 web_ui_->RegisterMessageCallback("getChildren", | 162 web_ui_->RegisterMessageCallback("getChildren", |
163 NewCallback(this, &SlideshowHandler::HandleGetChildren)); | 163 NewCallback(this, &SlideshowHandler::HandleGetChildren)); |
164 web_ui_->RegisterMessageCallback("refreshDirectory", | 164 web_ui_->RegisterMessageCallback("refreshDirectory", |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 | 275 |
276 SlideshowUI::SlideshowUI(TabContents* contents) : WebUI(contents) { | 276 SlideshowUI::SlideshowUI(TabContents* contents) : WebUI(contents) { |
277 SlideshowHandler* handler = new SlideshowHandler(); | 277 SlideshowHandler* handler = new SlideshowHandler(); |
278 AddMessageHandler((handler)->Attach(this)); | 278 AddMessageHandler((handler)->Attach(this)); |
279 handler->Init(); | 279 handler->Init(); |
280 SlideshowUIHTMLSource* html_source = new SlideshowUIHTMLSource(); | 280 SlideshowUIHTMLSource* html_source = new SlideshowUIHTMLSource(); |
281 | 281 |
282 // Set up the chrome://slideshow/ source. | 282 // Set up the chrome://slideshow/ source. |
283 contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source); | 283 contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source); |
284 } | 284 } |
OLD | NEW |