OLD | NEW |
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 "content/browser/media/cdm/browser_cdm_manager.h" | 5 #include "content/browser/media/cdm/browser_cdm_manager.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 render_frame_id, security_origin, cdm_id, init_data_type, | 510 render_frame_id, security_origin, cdm_id, init_data_type, |
511 init_data, base::Passed(&promise))); | 511 init_data, base::Passed(&promise))); |
512 return; | 512 return; |
513 } | 513 } |
514 | 514 |
515 RenderFrameHost* rfh = | 515 RenderFrameHost* rfh = |
516 RenderFrameHost::FromID(render_process_id_, render_frame_id); | 516 RenderFrameHost::FromID(render_process_id_, render_frame_id); |
517 WebContents* web_contents = WebContents::FromRenderFrameHost(rfh); | 517 WebContents* web_contents = WebContents::FromRenderFrameHost(rfh); |
518 DCHECK(web_contents); | 518 DCHECK(web_contents); |
519 GetContentClient()->browser()->RequestPermission( | 519 GetContentClient()->browser()->RequestPermission( |
520 content::PERMISSION_PROTECTED_MEDIA, web_contents, | 520 content::PERMISSION_PROTECTED_MEDIA_IDENTIFIER, web_contents, |
521 0, // bridge id | 521 0, // bridge id |
522 security_origin, | 522 security_origin, |
523 // Only implemented for Android infobars which do not support | 523 // Only implemented for Android infobars which do not support |
524 // user gestures. | 524 // user gestures. |
525 true, base::Bind(&BrowserCdmManager::GenerateRequestIfPermitted, this, | 525 true, base::Bind(&BrowserCdmManager::GenerateRequestIfPermitted, this, |
526 render_frame_id, cdm_id, init_data_type, init_data, | 526 render_frame_id, cdm_id, init_data_type, init_data, |
527 base::Passed(&promise))); | 527 base::Passed(&promise))); |
528 } | 528 } |
529 | 529 |
530 void BrowserCdmManager::GenerateRequestIfPermitted( | 530 void BrowserCdmManager::GenerateRequestIfPermitted( |
(...skipping 16 matching lines...) Expand all Loading... |
547 } | 547 } |
548 | 548 |
549 // Only the temporary session type is supported in browser CDM path. | 549 // Only the temporary session type is supported in browser CDM path. |
550 // TODO(xhwang): Add SessionType support if needed. | 550 // TODO(xhwang): Add SessionType support if needed. |
551 cdm->CreateSessionAndGenerateRequest(media::MediaKeys::TEMPORARY_SESSION, | 551 cdm->CreateSessionAndGenerateRequest(media::MediaKeys::TEMPORARY_SESSION, |
552 init_data_type, &init_data[0], | 552 init_data_type, &init_data[0], |
553 init_data.size(), promise.Pass()); | 553 init_data.size(), promise.Pass()); |
554 } | 554 } |
555 | 555 |
556 } // namespace content | 556 } // namespace content |
OLD | NEW |