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

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

Issue 2623693003: Move more vector icons into respective directories. (Closed)
Patch Set: Created 3 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
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 bfaa2744ea407cbe64c9f862d1deac747f6e5f2b..4c1987045891baa8f0f9aa21338b14cddf177841 100644
--- a/chrome/browser/ui/tabs/tab_utils.cc
+++ b/chrome/browser/ui/tabs/tab_utils.cc
@@ -9,6 +9,7 @@
#include "base/command_line.h"
#include "base/strings/string16.h"
#include "build/build_config.h"
+#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h"
#include "chrome/browser/media/webrtc/media_stream_capture_indicator.h"
#include "chrome/browser/themes/theme_properties.h"
@@ -23,7 +24,6 @@
#include "ui/gfx/animation/multi_animation.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/paint_vector_icon.h"
-#include "ui/gfx/vector_icons_public.h"
#include "ui/native_theme/common_theme.h"
#include "ui/native_theme/native_theme.h"
@@ -177,34 +177,31 @@ TabAlertState GetTabAlertStateForContents(content::WebContents* contents) {
gfx::Image GetTabAlertIndicatorImage(TabAlertState alert_state,
SkColor button_color) {
- gfx::VectorIconId icon_id = gfx::VectorIconId::VECTOR_ICON_NONE;
+ const gfx::VectorIcon* icon = nullptr;
switch (alert_state) {
case TabAlertState::AUDIO_PLAYING:
- icon_id = gfx::VectorIconId::TAB_AUDIO;
+ icon = &kTabAudioIcon;
break;
case TabAlertState::AUDIO_MUTING:
- icon_id = gfx::VectorIconId::TAB_AUDIO_MUTING;
+ icon = &kTabAudioMutingIcon;
break;
case TabAlertState::MEDIA_RECORDING:
- icon_id = gfx::VectorIconId::TAB_MEDIA_RECORDING;
+ icon = &kTabMediaRecordingIcon;
break;
case TabAlertState::TAB_CAPTURING:
- icon_id = gfx::VectorIconId::TAB_MEDIA_CAPTURING;
+ icon = &kTabMediaCapturingIcon;
break;
case TabAlertState::BLUETOOTH_CONNECTED:
- icon_id = gfx::VectorIconId::TAB_BLUETOOTH_CONNECTED;
+ icon = &kTabBluetoothConnectedIcon;
break;
case TabAlertState::USB_CONNECTED:
- icon_id = gfx::VectorIconId::TAB_USB_CONNECTED;
+ icon = &kTabUsbConnectedIcon;
break;
case TabAlertState::NONE:
- break;
+ return gfx::Image();
}
- if (icon_id != gfx::VectorIconId::VECTOR_ICON_NONE)
- return gfx::Image(gfx::CreateVectorIcon(icon_id, 16, button_color));
-
- NOTREACHED();
- return gfx::Image();
+ DCHECK(icon);
+ return gfx::Image(gfx::CreateVectorIcon(*icon, 16, button_color));
}
gfx::Image GetTabAlertIndicatorAffordanceImage(TabAlertState alert_state,
« no previous file with comments | « chrome/browser/ui/cocoa/hover_close_button.mm ('k') | chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698