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

Side by Side Diff: chrome/browser/media/media_stream_capture_indicator.cc

Issue 14318005: Allow media stream to display system tray icon on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 8 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 | no next file » | 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/media/media_stream_capture_indicator.h" 5 #include "chrome/browser/media/media_stream_capture_indicator.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/i18n/rtl.h" 8 #include "base/i18n/rtl.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 // destroyed and are capturing audio or video. 433 // destroyed and are capturing audio or video.
434 continue; 434 continue;
435 } 435 }
436 436
437 if (usage.IsCapturingScreen()) { 437 if (usage.IsCapturingScreen()) {
438 DCHECK(!screen_capturer); 438 DCHECK(!screen_capturer);
439 screen_capturer = web_contents; 439 screen_capturer = web_contents;
440 close_callback = usage.StopScreenCaptureCallback(); 440 close_callback = usage.StopScreenCaptureCallback();
441 } 441 }
442 442
443 // Audio/video icon is shown only for extensions. For regular tabs, we show 443 // Audio/video icon is shown only for extensions or on Android.
444 // an indicator in the tab icon. 444 // For regular tabs on desktop, we show an indicator in the tab icon.
445 if (GetExtension(web_contents) && 445 if ((usage.IsCapturingAudio() || usage.IsCapturingVideo())
446 (usage.IsCapturingAudio() || usage.IsCapturingVideo())) { 446 #if !defined(OS_ANDROID)
447 && GetExtension(web_contents)
448 #endif
449 ) {
447 audio = audio || usage.IsCapturingAudio(); 450 audio = audio || usage.IsCapturingAudio();
448 video = video || usage.IsCapturingVideo(); 451 video = video || usage.IsCapturingVideo();
449 452
450 command_targets_.push_back(web_contents); 453 command_targets_.push_back(web_contents);
451 menu->AddItem(command_id, GetTitle(web_contents)); 454 menu->AddItem(command_id, GetTitle(web_contents));
452 455
453 // If reaching the maximum number, no more item will be added to the menu. 456 // If reaching the maximum number, no more item will be added to the menu.
454 if (command_id == IDC_MEDIA_CONTEXT_MEDIA_STREAM_CAPTURE_LIST_LAST) 457 if (command_id == IDC_MEDIA_CONTEXT_MEDIA_STREAM_CAPTURE_LIST_LAST)
455 break; 458 break;
456 ++command_id; 459 ++command_id;
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 } 595 }
593 596
594 UpdateNotificationUserInterface(); 597 UpdateNotificationUserInterface();
595 } 598 }
596 599
597 void MediaStreamCaptureIndicator::OnStopScreenCapture( 600 void MediaStreamCaptureIndicator::OnStopScreenCapture(
598 const base::Closure& stop) { 601 const base::Closure& stop) {
599 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 602 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
600 stop.Run(); 603 stop.Run();
601 } 604 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698