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

Side by Side Diff: chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc

Issue 1990323002: [Media Router WebUI] Handle route details in incognito. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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
« no previous file with comments | « chrome/browser/resources/media_router/media_router_ui_interface.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 std::unique_ptr<base::ListValue> routes(RoutesToValue( 403 std::unique_ptr<base::ListValue> routes(RoutesToValue(
404 media_router_ui_->routes(), media_router_ui_->joinable_route_ids(), 404 media_router_ui_->routes(), media_router_ui_->joinable_route_ids(),
405 media_router_ui_->GetRouteProviderExtensionId())); 405 media_router_ui_->GetRouteProviderExtensionId()));
406 initial_data.Set("routes", routes.release()); 406 initial_data.Set("routes", routes.release());
407 407
408 const std::set<MediaCastMode> cast_modes = media_router_ui_->cast_modes(); 408 const std::set<MediaCastMode> cast_modes = media_router_ui_->cast_modes();
409 std::unique_ptr<base::ListValue> cast_modes_list(CastModesToValue( 409 std::unique_ptr<base::ListValue> cast_modes_list(CastModesToValue(
410 cast_modes, media_router_ui_->GetPresentationRequestSourceName())); 410 cast_modes, media_router_ui_->GetPresentationRequestSourceName()));
411 initial_data.Set("castModes", cast_modes_list.release()); 411 initial_data.Set("castModes", cast_modes_list.release());
412 412
413 Profile* profile = Profile::FromWebUI(web_ui());
414 initial_data.SetBoolean("isOffTheRecord", profile->IsOffTheRecord());
415
413 web_ui()->CallJavascriptFunction(kSetInitialData, initial_data); 416 web_ui()->CallJavascriptFunction(kSetInitialData, initial_data);
414 media_router_ui_->UIInitialized(); 417 media_router_ui_->UIInitialized();
415 } 418 }
416 419
417 void MediaRouterWebUIMessageHandler::OnCreateRoute( 420 void MediaRouterWebUIMessageHandler::OnCreateRoute(
418 const base::ListValue* args) { 421 const base::ListValue* args) {
419 DVLOG(1) << "OnCreateRoute"; 422 DVLOG(1) << "OnCreateRoute";
420 const base::DictionaryValue* args_dict = nullptr; 423 const base::DictionaryValue* args_dict = nullptr;
421 std::string sink_id; 424 std::string sink_id;
422 int cast_mode_num = -1; 425 int cast_mode_num = -1;
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 #endif // defined(GOOGLE_CHROME_BUILD) 820 #endif // defined(GOOGLE_CHROME_BUILD)
818 821
819 return AccountInfo(); 822 return AccountInfo();
820 } 823 }
821 824
822 void MediaRouterWebUIMessageHandler::SetWebUIForTest(content::WebUI* web_ui) { 825 void MediaRouterWebUIMessageHandler::SetWebUIForTest(content::WebUI* web_ui) {
823 set_web_ui(web_ui); 826 set_web_ui(web_ui);
824 } 827 }
825 828
826 } // namespace media_router 829 } // namespace media_router
OLDNEW
« no previous file with comments | « chrome/browser/resources/media_router/media_router_ui_interface.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698