Chromium Code Reviews| 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..d5a169048da95ff57e86058b6b1a4d445c0fbcee 100644 |
| --- a/chrome/browser/ui/tabs/tab_utils.cc |
| +++ b/chrome/browser/ui/tabs/tab_utils.cc |
| @@ -16,17 +16,19 @@ |
| #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) |
|
miu
2016/01/07 20:08:09
nit: For readability, please negate the expression
Evan Stade
2016/01/08 21:47:02
Done.
|
| #include "ui/gfx/paint_vector_icon.h" |
| +#else |
| +#include "grit/theme_resources.h" |
| +#include "ui/base/resource/resource_bundle.h" |
| #endif |
| struct LastMuteMetadata |
| @@ -167,23 +169,33 @@ TabMediaState GetTabMediaStateForContents(content::WebContents* contents) { |
| gfx::Image GetTabMediaIndicatorImage(TabMediaState media_state, |
| SkColor button_color) { |
| - ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
| - switch (media_state) { |
| #if !defined(OS_MACOSX) |
|
miu
2016/01/07 20:08:09
ditto: negate expression for readability
Evan Stade
2016/01/08 21:47:02
Done.
|
| + gfx::VectorIconId icon_id = gfx::VectorIconId::VECTOR_ICON_NONE; |
| + switch (media_state) { |
| 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)); |
| - } |
| + 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)); |
| #else |
| + ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
| + switch (media_state) { |
| 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 +203,7 @@ gfx::Image GetTabMediaIndicatorImage(TabMediaState media_state, |
| case TAB_MEDIA_STATE_NONE: |
| break; |
| } |
| +#endif |
| NOTREACHED(); |
| return gfx::Image(); |
| } |