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

Side by Side Diff: chrome/browser/chromeos/display/output_protection_delegate.cc

Issue 2095963004: Revert of media: Add OutputProtectionProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/media/encrypted_media_browsertest.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/chromeos/display/output_protection_delegate.h" 5 #include "chrome/browser/chromeos/display/output_protection_delegate.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_delegate.h" 8 #include "ash/shell_delegate.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/media/media_capture_devices_dispatcher.h"
10 #include "content/public/browser/browser_thread.h" 11 #include "content/public/browser/browser_thread.h"
11 #include "content/public/browser/render_frame_host.h" 12 #include "content/public/browser/render_frame_host.h"
12 #include "content/public/browser/web_contents.h" 13 #include "content/public/browser/web_contents.h"
13 #include "ui/display/display.h" 14 #include "ui/display/display.h"
14 #include "ui/display/screen.h" 15 #include "ui/display/screen.h"
15 16
16 namespace chromeos { 17 namespace chromeos {
17 18
18 namespace { 19 namespace {
19 20
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 content::RenderFrameHost* rfh = 126 content::RenderFrameHost* rfh =
126 content::RenderFrameHost::FromID(render_process_id_, render_frame_id_); 127 content::RenderFrameHost::FromID(render_process_id_, render_frame_id_);
127 // TODO(xjz): Investigate whether this check (and the other one above) should 128 // TODO(xjz): Investigate whether this check (and the other one above) should
128 // be removed. 129 // be removed.
129 if (!rfh) { 130 if (!rfh) {
130 LOG(WARNING) << "RenderFrameHost is not alive."; 131 LOG(WARNING) << "RenderFrameHost is not alive.";
131 callback.Run(false, 0, 0); 132 callback.Run(false, 0, 0);
132 return; 133 return;
133 } 134 }
134 135
135 callback.Run(response.success, response.link_mask, response.protection_mask); 136 uint32_t link_mask = response.link_mask;
137 // If we successfully retrieved the device level status, check for capturers.
138 if (response.success) {
139 const bool insecure_capture_detected =
140 MediaCaptureDevicesDispatcher::GetInstance()
141 ->IsInsecureCapturingInProgress(render_process_id_,
142 render_frame_id_);
143 if (insecure_capture_detected)
144 link_mask |= ui::DISPLAY_CONNECTION_TYPE_NETWORK;
145 }
146
147 callback.Run(response.success, link_mask, response.protection_mask);
136 } 148 }
137 149
138 void OutputProtectionDelegate::EnableProtectionComplete( 150 void OutputProtectionDelegate::EnableProtectionComplete(
139 const EnableProtectionCallback& callback, 151 const EnableProtectionCallback& callback,
140 bool success) { 152 bool success) {
141 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 153 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
142 154
143 callback.Run(success); 155 callback.Run(success);
144 } 156 }
145 157
(...skipping 26 matching lines...) Expand all
172 display_id_ = new_display_id; 184 display_id_ = new_display_id;
173 } 185 }
174 186
175 void OutputProtectionDelegate::OnWindowDestroying(aura::Window* window) { 187 void OutputProtectionDelegate::OnWindowDestroying(aura::Window* window) {
176 DCHECK_EQ(window, window_); 188 DCHECK_EQ(window, window_);
177 window_->RemoveObserver(this); 189 window_->RemoveObserver(this);
178 window_ = nullptr; 190 window_ = nullptr;
179 } 191 }
180 192
181 } // namespace chromeos 193 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media/encrypted_media_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698