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/mediaplayer_ui.h" | 5 #include "chrome/browser/ui/webui/mediaplayer_ui.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 is_playlist_(is_playlist) { | 204 is_playlist_(is_playlist) { |
205 } | 205 } |
206 | 206 |
207 MediaplayerHandler::~MediaplayerHandler() { | 207 MediaplayerHandler::~MediaplayerHandler() { |
208 } | 208 } |
209 | 209 |
210 WebUIMessageHandler* MediaplayerHandler::Attach(WebUI* web_ui) { | 210 WebUIMessageHandler* MediaplayerHandler::Attach(WebUI* web_ui) { |
211 // Create our favicon data source. | 211 // Create our favicon data source. |
212 Profile* profile = web_ui->GetProfile(); | 212 Profile* profile = web_ui->GetProfile(); |
213 profile->GetChromeURLDataManager()->AddDataSource( | 213 profile->GetChromeURLDataManager()->AddDataSource( |
214 new FaviconSource(profile)); | 214 new FaviconSource(profile, chrome::kChromeUIFaviconHost)); |
215 | 215 |
216 return WebUIMessageHandler::Attach(web_ui); | 216 return WebUIMessageHandler::Attach(web_ui); |
217 } | 217 } |
218 | 218 |
219 void MediaplayerHandler::Init(bool is_playlist, TabContents* contents) { | 219 void MediaplayerHandler::Init(bool is_playlist, TabContents* contents) { |
220 MediaPlayer* player = MediaPlayer::GetInstance(); | 220 MediaPlayer* player = MediaPlayer::GetInstance(); |
221 if (!is_playlist) { | 221 if (!is_playlist) { |
222 player->SetNewHandler(this, contents); | 222 player->SetNewHandler(this, contents); |
223 } else { | 223 } else { |
224 player->RegisterNewPlaylistHandler(this, contents); | 224 player->RegisterNewPlaylistHandler(this, contents); |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 } else { | 604 } else { |
605 handler->Init(false, contents); | 605 handler->Init(false, contents); |
606 } | 606 } |
607 | 607 |
608 MediaplayerUIHTMLSource* html_source = | 608 MediaplayerUIHTMLSource* html_source = |
609 new MediaplayerUIHTMLSource(is_playlist); | 609 new MediaplayerUIHTMLSource(is_playlist); |
610 | 610 |
611 // Set up the chrome://mediaplayer/ source. | 611 // Set up the chrome://mediaplayer/ source. |
612 contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source); | 612 contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source); |
613 } | 613 } |
OLD | NEW |