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

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

Issue 1561923005: Vectorize tab recording and capturing icons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: miu nits Created 4 years, 11 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/app/theme/theme_resources.grd ('k') | ui/gfx/BUILD.gn » ('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 44c091eb53b9ed0ed4e46b718b940f254408eaf8..6f03143edf3140cbc94b70467478740014d26d66 100644
--- a/chrome/browser/ui/tabs/tab_utils.cc
+++ b/chrome/browser/ui/tabs/tab_utils.cc
@@ -16,16 +16,18 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/grit/generated_resources.h"
#include "content/public/browser/web_contents.h"
-#include "grit/theme_resources.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/resource/resource_bundle.h"
#include "ui/base/theme_provider.h"
#include "ui/gfx/animation/multi_animation.h"
+#include "ui/gfx/image/image.h"
#include "ui/gfx/vector_icons_public.h"
#include "ui/native_theme/common_theme.h"
#include "ui/native_theme/native_theme.h"
-#if !defined(OS_MACOSX)
+#if defined(OS_MACOSX)
+#include "grit/theme_resources.h"
+#include "ui/base/resource/resource_bundle.h"
+#else
#include "ui/gfx/paint_vector_icon.h"
#endif
@@ -167,23 +169,13 @@ TabMediaState GetTabMediaStateForContents(content::WebContents* contents) {
gfx::Image GetTabMediaIndicatorImage(TabMediaState media_state,
SkColor button_color) {
+#if defined(OS_MACOSX)
ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
switch (media_state) {
-#if !defined(OS_MACOSX)
- case TAB_MEDIA_STATE_AUDIO_PLAYING:
- case TAB_MEDIA_STATE_AUDIO_MUTING: {
- return gfx::Image(
- gfx::CreateVectorIcon(media_state == TAB_MEDIA_STATE_AUDIO_PLAYING
- ? gfx::VectorIconId::TAB_AUDIO
- : gfx::VectorIconId::TAB_AUDIO_MUTING,
- 16, button_color));
- }
-#else
case TAB_MEDIA_STATE_AUDIO_PLAYING:
return rb->GetNativeImageNamed(IDR_TAB_AUDIO_INDICATOR);
case TAB_MEDIA_STATE_AUDIO_MUTING:
return rb->GetNativeImageNamed(IDR_TAB_AUDIO_MUTING_INDICATOR);
-#endif
case TAB_MEDIA_STATE_RECORDING:
return rb->GetNativeImageNamed(IDR_TAB_RECORDING_INDICATOR);
case TAB_MEDIA_STATE_CAPTURING:
@@ -191,6 +183,27 @@ gfx::Image GetTabMediaIndicatorImage(TabMediaState media_state,
case TAB_MEDIA_STATE_NONE:
break;
}
+#else
+ gfx::VectorIconId icon_id = gfx::VectorIconId::VECTOR_ICON_NONE;
+ switch (media_state) {
+ case TAB_MEDIA_STATE_AUDIO_PLAYING:
+ icon_id = gfx::VectorIconId::TAB_AUDIO;
+ break;
+ case TAB_MEDIA_STATE_AUDIO_MUTING:
+ icon_id = gfx::VectorIconId::TAB_AUDIO_MUTING;
+ break;
+ case TAB_MEDIA_STATE_RECORDING:
+ icon_id = gfx::VectorIconId::TAB_MEDIA_RECORDING;
+ break;
+ case TAB_MEDIA_STATE_CAPTURING:
+ icon_id = gfx::VectorIconId::TAB_MEDIA_CAPTURING;
+ break;
+ case TAB_MEDIA_STATE_NONE:
+ break;
+ }
+ if (icon_id != gfx::VectorIconId::VECTOR_ICON_NONE)
+ return gfx::Image(gfx::CreateVectorIcon(icon_id, 16, button_color));
+#endif
NOTREACHED();
return gfx::Image();
}
« no previous file with comments | « chrome/app/theme/theme_resources.grd ('k') | ui/gfx/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698