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

Unified Diff: chrome/browser/ui/tabs/tab_utils.cc

Issue 1746333002: bluetooth: Show tab indicator when BT device is connected (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: mute -> connected Created 4 years, 9 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 | « chrome/browser/ui/tabs/tab_utils.h ('k') | content/browser/bluetooth/bluetooth_dispatcher_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/tabs/tab_utils.cc
diff --git a/chrome/browser/ui/tabs/tab_utils.cc b/chrome/browser/ui/tabs/tab_utils.cc
index 6f03143edf3140cbc94b70467478740014d26d66..ada42a7a3513a9edbc2935a0224c9de65b6faf97 100644
--- a/chrome/browser/ui/tabs/tab_utils.cc
+++ b/chrome/browser/ui/tabs/tab_utils.cc
@@ -159,6 +159,9 @@ TabMediaState GetTabMediaStateForContents(content::WebContents* contents) {
return TAB_MEDIA_STATE_RECORDING;
}
+ if (contents->IsBluetoothDeviceConnected())
+ return TAB_MEDIA_STATE_BLUETOOTH_CONNECTED;
+
if (contents->IsAudioMuted())
return TAB_MEDIA_STATE_AUDIO_MUTING;
if (contents->WasRecentlyAudible())
@@ -180,6 +183,8 @@ gfx::Image GetTabMediaIndicatorImage(TabMediaState media_state,
return rb->GetNativeImageNamed(IDR_TAB_RECORDING_INDICATOR);
case TAB_MEDIA_STATE_CAPTURING:
return rb->GetNativeImageNamed(IDR_TAB_CAPTURE_INDICATOR);
+ case TAB_MEDIA_STATE_BLUETOOTH_CONNECTED:
+ return rb->GetNativeImageNamed(IDR_TAB_BLUETOOTH_INDICATOR);
case TAB_MEDIA_STATE_NONE:
break;
}
@@ -198,6 +203,9 @@ gfx::Image GetTabMediaIndicatorImage(TabMediaState media_state,
case TAB_MEDIA_STATE_CAPTURING:
icon_id = gfx::VectorIconId::TAB_MEDIA_CAPTURING;
break;
+ case TAB_MEDIA_STATE_BLUETOOTH_CONNECTED:
+ icon_id = gfx::VectorIconId::TAB_BLUETOOTH_CONNECTED;
+ break;
case TAB_MEDIA_STATE_NONE:
break;
}
@@ -218,6 +226,7 @@ gfx::Image GetTabMediaIndicatorAffordanceImage(TabMediaState media_state,
case TAB_MEDIA_STATE_NONE:
case TAB_MEDIA_STATE_RECORDING:
case TAB_MEDIA_STATE_CAPTURING:
+ case TAB_MEDIA_STATE_BLUETOOTH_CONNECTED:
return GetTabMediaIndicatorImage(media_state, button_color);
}
NOTREACHED();
@@ -271,6 +280,10 @@ base::string16 AssembleTabTooltipText(const base::string16& title,
result.append(
l10n_util::GetStringUTF16(IDS_TOOLTIP_TAB_MEDIA_STATE_CAPTURING));
break;
+ case TAB_MEDIA_STATE_BLUETOOTH_CONNECTED:
+ result.append(
+ l10n_util::GetStringUTF16(IDS_TOOLTIP_TAB_BLUETOOTH_CONNECTED));
+ break;
case TAB_MEDIA_STATE_NONE:
NOTREACHED();
break;
@@ -291,6 +304,7 @@ bool CanToggleAudioMute(content::WebContents* contents) {
return true;
case TAB_MEDIA_STATE_RECORDING:
case TAB_MEDIA_STATE_CAPTURING:
+ case TAB_MEDIA_STATE_BLUETOOTH_CONNECTED:
return false;
}
NOTREACHED();
« no previous file with comments | « chrome/browser/ui/tabs/tab_utils.h ('k') | content/browser/bluetooth/bluetooth_dispatcher_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698