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

Unified Diff: ash/system/cast/tray_cast.cc

Issue 1145833003: Allow the cast tray to function as expected when the installed extension is missing API methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add bug to comment Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/cast_config_delegate.h ('k') | chrome/browser/ui/ash/cast_config_delegate_chromeos.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/cast/tray_cast.cc
diff --git a/ash/system/cast/tray_cast.cc b/ash/system/cast/tray_cast.cc
index d6627628ab0d7e015f32bc474e74f4ee63025252..355eb404d27750dfe60dce19869fdb21fcc125be 100644
--- a/ash/system/cast/tray_cast.cc
+++ b/ash/system/cast/tray_cast.cc
@@ -38,28 +38,6 @@ namespace ash {
namespace {
const int kStopButtonRightPadding = 18;
-
-// Callback helper for StopCast().
-void StopCastCallback(
- CastConfigDelegate* cast_config,
- const CastConfigDelegate::ReceiversAndActivites& receivers_activities) {
- for (auto& item : receivers_activities) {
- CastConfigDelegate::Activity activity = item.second.activity;
- if (activity.allow_stop && activity.id.empty() == false)
- cast_config->StopCasting(activity.id);
- }
-}
-
-// Stops currently casting device.
-void StopCast() {
- CastConfigDelegate* cast_config =
- Shell::GetInstance()->system_tray_delegate()->GetCastConfigDelegate();
- if (cast_config && cast_config->HasCastExtension()) {
- cast_config->GetReceiversAndActivities(
- base::Bind(&StopCastCallback, cast_config));
- }
-}
-
} // namespace
namespace tray {
@@ -182,12 +160,16 @@ CastCastView::CastCastView(CastConfigDelegate* cast_config_delegate)
title_ = new views::Label;
title_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
title_->SetFontList(bundle.GetFontList(ui::ResourceBundle::BoldFont));
+ title_->SetText(
+ bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_CAST_UNKNOWN_CAST_TYPE));
label_container_->AddChildView(title_);
details_ = new views::Label;
details_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
details_->SetMultiLine(false);
details_->SetEnabledColor(kHeaderTextColorNormal);
+ details_->SetText(
+ bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_CAST_UNKNOWN_RECEIVER));
label_container_->AddChildView(details_);
AddChildView(label_container_);
@@ -270,7 +252,7 @@ void CastCastView::UpdateLabelCallback(
void CastCastView::ButtonPressed(views::Button* sender,
const ui::Event& event) {
DCHECK(sender == stop_button_);
- StopCast();
+ cast_config_delegate_->StopCasting();
}
// This view by itself does very little. It acts as a front-end for managing
« no previous file with comments | « ash/cast_config_delegate.h ('k') | chrome/browser/ui/ash/cast_config_delegate_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698