| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/tabs/tab_utils.h" | 5 #include "chrome/browser/ui/tabs/tab_utils.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 if (contents->IsAudioMuted()) | 170 if (contents->IsAudioMuted()) |
| 171 return TabAlertState::AUDIO_MUTING; | 171 return TabAlertState::AUDIO_MUTING; |
| 172 if (contents->WasRecentlyAudible()) | 172 if (contents->WasRecentlyAudible()) |
| 173 return TabAlertState::AUDIO_PLAYING; | 173 return TabAlertState::AUDIO_PLAYING; |
| 174 | 174 |
| 175 return TabAlertState::NONE; | 175 return TabAlertState::NONE; |
| 176 } | 176 } |
| 177 | 177 |
| 178 gfx::Image GetTabAlertIndicatorImage(TabAlertState alert_state, | 178 gfx::Image GetTabAlertIndicatorImage(TabAlertState alert_state, |
| 179 SkColor button_color) { | 179 SkColor button_color) { |
| 180 #if defined(OS_MACOSX) | |
| 181 if (!ui::MaterialDesignController::IsModeMaterial()) { | |
| 182 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); | |
| 183 switch (alert_state) { | |
| 184 case TabAlertState::AUDIO_PLAYING: | |
| 185 return rb->GetNativeImageNamed(IDR_TAB_AUDIO_INDICATOR); | |
| 186 case TabAlertState::AUDIO_MUTING: | |
| 187 return rb->GetNativeImageNamed(IDR_TAB_AUDIO_MUTING_INDICATOR); | |
| 188 case TabAlertState::MEDIA_RECORDING: | |
| 189 return rb->GetNativeImageNamed(IDR_TAB_RECORDING_INDICATOR); | |
| 190 case TabAlertState::TAB_CAPTURING: | |
| 191 return rb->GetNativeImageNamed(IDR_TAB_CAPTURE_INDICATOR); | |
| 192 case TabAlertState::BLUETOOTH_CONNECTED: | |
| 193 return rb->GetNativeImageNamed(IDR_TAB_BLUETOOTH_INDICATOR); | |
| 194 case TabAlertState::USB_CONNECTED: | |
| 195 return rb->GetNativeImageNamed(IDR_TAB_USB_INDICATOR); | |
| 196 case TabAlertState::NONE: | |
| 197 break; | |
| 198 } | |
| 199 NOTREACHED(); | |
| 200 return gfx::Image(); | |
| 201 } | |
| 202 #endif | |
| 203 | |
| 204 gfx::VectorIconId icon_id = gfx::VectorIconId::VECTOR_ICON_NONE; | 180 gfx::VectorIconId icon_id = gfx::VectorIconId::VECTOR_ICON_NONE; |
| 205 switch (alert_state) { | 181 switch (alert_state) { |
| 206 case TabAlertState::AUDIO_PLAYING: | 182 case TabAlertState::AUDIO_PLAYING: |
| 207 icon_id = gfx::VectorIconId::TAB_AUDIO; | 183 icon_id = gfx::VectorIconId::TAB_AUDIO; |
| 208 break; | 184 break; |
| 209 case TabAlertState::AUDIO_MUTING: | 185 case TabAlertState::AUDIO_MUTING: |
| 210 icon_id = gfx::VectorIconId::TAB_AUDIO_MUTING; | 186 icon_id = gfx::VectorIconId::TAB_AUDIO_MUTING; |
| 211 break; | 187 break; |
| 212 case TabAlertState::MEDIA_RECORDING: | 188 case TabAlertState::MEDIA_RECORDING: |
| 213 icon_id = gfx::VectorIconId::TAB_MEDIA_RECORDING; | 189 icon_id = gfx::VectorIconId::TAB_MEDIA_RECORDING; |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 const std::vector<int>& indices) { | 374 const std::vector<int>& indices) { |
| 399 for (std::vector<int>::const_iterator i = indices.begin(); i != indices.end(); | 375 for (std::vector<int>::const_iterator i = indices.begin(); i != indices.end(); |
| 400 ++i) { | 376 ++i) { |
| 401 if (!tab_strip.GetWebContentsAt(*i)->IsAudioMuted()) | 377 if (!tab_strip.GetWebContentsAt(*i)->IsAudioMuted()) |
| 402 return false; | 378 return false; |
| 403 } | 379 } |
| 404 return true; | 380 return true; |
| 405 } | 381 } |
| 406 | 382 |
| 407 } // namespace chrome | 383 } // namespace chrome |
| OLD | NEW |