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

Side by Side Diff: chrome/browser/ui/ash/media_delegate_chromeos.cc

Issue 2375663002: Replace MessageLoop::current()->task_runner() with ThreadTaskRunnerHandle::Get(). (Closed)
Patch Set: rebase Created 4 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ash/media_delegate_chromeos.h" 5 #include "chrome/browser/ui/ash/media_delegate_chromeos.h"
6 6
7 #include "ash/common/system/tray/system_tray_notifier.h" 7 #include "ash/common/system/tray/system_tray_notifier.h"
8 #include "ash/common/wm_shell.h" 8 #include "ash/common/wm_shell.h"
9 #include "ash/content/shell_content_state.h" 9 #include "ash/content/shell_content_state.h"
10 #include "base/location.h" 10 #include "base/location.h"
11 #include "base/logging.h"
11 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
12 #include "base/single_thread_task_runner.h" 13 #include "base/single_thread_task_runner.h"
14 #include "base/threading/thread_task_runner_handle.h"
13 #include "chrome/browser/chromeos/extensions/media_player_api.h" 15 #include "chrome/browser/chromeos/extensions/media_player_api.h"
14 #include "chrome/browser/chromeos/extensions/media_player_event_router.h" 16 #include "chrome/browser/chromeos/extensions/media_player_event_router.h"
15 #include "chrome/browser/media/webrtc/media_stream_capture_indicator.h" 17 #include "chrome/browser/media/webrtc/media_stream_capture_indicator.h"
16 #include "chrome/browser/profiles/profile_manager.h" 18 #include "chrome/browser/profiles/profile_manager.h"
17 #include "chrome/browser/ui/browser.h" 19 #include "chrome/browser/ui/browser.h"
18 #include "chrome/browser/ui/browser_list.h" 20 #include "chrome/browser/ui/browser_list.h"
19 #include "chrome/browser/ui/browser_window.h" 21 #include "chrome/browser/ui/browser_window.h"
20 #include "chrome/browser/ui/tabs/tab_strip_model.h" 22 #include "chrome/browser/ui/tabs/tab_strip_model.h"
21 #include "content/public/browser/render_view_host.h" 23 #include "content/public/browser/render_view_host.h"
22 #include "content/public/browser/web_contents.h" 24 #include "content/public/browser/web_contents.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 content::BrowserContext* context = 151 content::BrowserContext* context =
150 ash::ShellContentState::GetInstance()->GetBrowserContextByIndex(index); 152 ash::ShellContentState::GetInstance()->GetBrowserContextByIndex(index);
151 return GetMediaCaptureStateOfAllWebContents(context); 153 return GetMediaCaptureStateOfAllWebContents(context);
152 } 154 }
153 155
154 void MediaDelegateChromeOS::OnRequestUpdate( 156 void MediaDelegateChromeOS::OnRequestUpdate(
155 int render_process_id, 157 int render_process_id,
156 int render_frame_id, 158 int render_frame_id,
157 content::MediaStreamType stream_type, 159 content::MediaStreamType stream_type,
158 const content::MediaRequestState state) { 160 const content::MediaRequestState state) {
159 base::MessageLoopForUI::current()->task_runner()->PostTask( 161 DCHECK(base::MessageLoopForUI::IsCurrent());
162 base::ThreadTaskRunnerHandle::Get()->PostTask(
160 FROM_HERE, base::Bind(&MediaDelegateChromeOS::NotifyMediaCaptureChange, 163 FROM_HERE, base::Bind(&MediaDelegateChromeOS::NotifyMediaCaptureChange,
161 weak_ptr_factory_.GetWeakPtr())); 164 weak_ptr_factory_.GetWeakPtr()));
162 } 165 }
163 166
164 void MediaDelegateChromeOS::NotifyMediaCaptureChange() { 167 void MediaDelegateChromeOS::NotifyMediaCaptureChange() {
165 ash::WmShell::Get()->system_tray_notifier()->NotifyMediaCaptureChanged(); 168 ash::WmShell::Get()->system_tray_notifier()->NotifyMediaCaptureChanged();
166 } 169 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/login_ui_keyboard_browsertest.cc ('k') | chrome/browser/ui/views/chrome_views_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698