| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/media_router/media_router_webui_message_handle
r.h" | 5 #include "chrome/browser/ui/webui/media_router/media_router_webui_message_handle
r.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 base::Bind(&MediaRouterWebUIMessageHandler::OnInitialDataReceived, | 324 base::Bind(&MediaRouterWebUIMessageHandler::OnInitialDataReceived, |
| 325 base::Unretained(this))); | 325 base::Unretained(this))); |
| 326 } | 326 } |
| 327 | 327 |
| 328 void MediaRouterWebUIMessageHandler::OnRequestInitialData( | 328 void MediaRouterWebUIMessageHandler::OnRequestInitialData( |
| 329 const base::ListValue* args) { | 329 const base::ListValue* args) { |
| 330 DVLOG(1) << "OnRequestInitialData"; | 330 DVLOG(1) << "OnRequestInitialData"; |
| 331 media_router_ui_->OnUIInitiallyLoaded(); | 331 media_router_ui_->OnUIInitiallyLoaded(); |
| 332 base::DictionaryValue initial_data; | 332 base::DictionaryValue initial_data; |
| 333 | 333 |
| 334 #if defined(GOOGLE_CHROME_BUILD) |
| 335 // "Casting to a Hangout from Chrome" Chromecast help center page. |
| 336 initial_data.SetString("firstRunFlowCloudPrefLearnMoreUrl", |
| 337 base::StringPrintf(kHelpPageUrlPrefix, 6320939)); |
| 338 #endif // defined(GOOGLE_CHROME_BUILD) |
| 334 // "No Cast devices found?" Chromecast help center page. | 339 // "No Cast devices found?" Chromecast help center page. |
| 335 initial_data.SetString("deviceMissingUrl", | 340 initial_data.SetString("deviceMissingUrl", |
| 336 base::StringPrintf(kHelpPageUrlPrefix, 3249268)); | 341 base::StringPrintf(kHelpPageUrlPrefix, 3249268)); |
| 337 | 342 |
| 338 scoped_ptr<base::ListValue> sinks(SinksToValue(media_router_ui_->sinks())); | 343 scoped_ptr<base::ListValue> sinks(SinksToValue(media_router_ui_->sinks())); |
| 339 initial_data.Set("sinks", sinks.release()); | 344 initial_data.Set("sinks", sinks.release()); |
| 340 | 345 |
| 341 scoped_ptr<base::ListValue> routes(RoutesToValue(media_router_ui_->routes(), | 346 scoped_ptr<base::ListValue> routes(RoutesToValue(media_router_ui_->routes(), |
| 342 media_router_ui_->joinable_route_ids(), | 347 media_router_ui_->joinable_route_ids(), |
| 343 media_router_ui_->GetRouteProviderExtensionId())); | 348 media_router_ui_->GetRouteProviderExtensionId())); |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 open_args->AppendString(learn_more_url); | 636 open_args->AppendString(learn_more_url); |
| 632 web_ui()->CallJavascriptFunction(kWindowOpen, *open_args); | 637 web_ui()->CallJavascriptFunction(kWindowOpen, *open_args); |
| 633 return true; | 638 return true; |
| 634 } else { | 639 } else { |
| 635 // Do nothing; no other issue action types require any other action. | 640 // Do nothing; no other issue action types require any other action. |
| 636 return true; | 641 return true; |
| 637 } | 642 } |
| 638 } | 643 } |
| 639 | 644 |
| 640 } // namespace media_router | 645 } // namespace media_router |
| OLD | NEW |