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

Side by Side Diff: chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc

Issue 12328027: Audio indicator in each tab (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/views/tabs/browser_tab_strip_controller.h" 5 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 data->show_icon = favicon_tab_helper->ShouldDisplayFavicon(); 448 data->show_icon = favicon_tab_helper->ShouldDisplayFavicon();
449 data->mini = model_->IsMiniTab(model_index); 449 data->mini = model_->IsMiniTab(model_index);
450 data->blocked = model_->IsTabBlocked(model_index); 450 data->blocked = model_->IsTabBlocked(model_index);
451 data->app = extensions::TabHelper::FromWebContents(contents)->is_app(); 451 data->app = extensions::TabHelper::FromWebContents(contents)->is_app();
452 if (chrome::ShouldShowProjectingIndicator(contents)) 452 if (chrome::ShouldShowProjectingIndicator(contents))
453 data->capture_state = TabRendererData::CAPTURE_STATE_PROJECTING; 453 data->capture_state = TabRendererData::CAPTURE_STATE_PROJECTING;
454 else if (chrome::ShouldShowRecordingIndicator(contents)) 454 else if (chrome::ShouldShowRecordingIndicator(contents))
455 data->capture_state = TabRendererData::CAPTURE_STATE_RECORDING; 455 data->capture_state = TabRendererData::CAPTURE_STATE_RECORDING;
456 else 456 else
457 data->capture_state = TabRendererData::CAPTURE_STATE_NONE; 457 data->capture_state = TabRendererData::CAPTURE_STATE_NONE;
458
459 if (chrome::IsPlayingAudio(contents))
460 data->audio_state = TabRendererData::AUDIO_STATE_PLAYING;
461 else
462 data->audio_state = TabRendererData::AUDIO_STATE_NONE;
458 } 463 }
459 464
460 void BrowserTabStripController::SetTabDataAt(content::WebContents* web_contents, 465 void BrowserTabStripController::SetTabDataAt(content::WebContents* web_contents,
461 int model_index) { 466 int model_index) {
462 TabRendererData data; 467 TabRendererData data;
463 SetTabRendererDataFromModel(web_contents, model_index, &data, EXISTING_TAB); 468 SetTabRendererDataFromModel(web_contents, model_index, &data, EXISTING_TAB);
464 tabstrip_->SetTabData(model_index, data); 469 tabstrip_->SetTabData(model_index, data);
465 } 470 }
466 471
467 void BrowserTabStripController::StartHighlightTabsForCommand( 472 void BrowserTabStripController::StartHighlightTabsForCommand(
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 SetTabRendererDataFromModel(contents, index, &data, NEW_TAB); 506 SetTabRendererDataFromModel(contents, index, &data, NEW_TAB);
502 tabstrip_->AddTabAt(index, data, is_active); 507 tabstrip_->AddTabAt(index, data, is_active);
503 } 508 }
504 509
505 void BrowserTabStripController::UpdateLayoutType() { 510 void BrowserTabStripController::UpdateLayoutType() {
506 bool adjust_layout = false; 511 bool adjust_layout = false;
507 TabStripLayoutType layout_type = 512 TabStripLayoutType layout_type =
508 DetermineTabStripLayout(g_browser_process->local_state(), &adjust_layout); 513 DetermineTabStripLayout(g_browser_process->local_state(), &adjust_layout);
509 tabstrip_->SetLayoutType(layout_type, adjust_layout); 514 tabstrip_->SetLayoutType(layout_type, adjust_layout);
510 } 515 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698