OLD | NEW |
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/attestation/platform_verification_flow.h" | 5 #include "chrome/browser/chromeos/attestation/platform_verification_flow.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 Profile::FromBrowserContext(web_contents->GetBrowserContext())); | 105 Profile::FromBrowserContext(web_contents->GetBrowserContext())); |
106 } | 106 } |
107 | 107 |
108 bool IsPermittedByUser(content::WebContents* web_contents) override { | 108 bool IsPermittedByUser(content::WebContents* web_contents) override { |
109 // TODO(xhwang): Using delegate_->GetURL() here is not right. The platform | 109 // TODO(xhwang): Using delegate_->GetURL() here is not right. The platform |
110 // verification may be requested by a frame from a different origin. This | 110 // verification may be requested by a frame from a different origin. This |
111 // will be solved when http://crbug.com/454847 is fixed. | 111 // will be solved when http://crbug.com/454847 is fixed. |
112 const GURL& requesting_origin = GetURL(web_contents).GetOrigin(); | 112 const GURL& requesting_origin = GetURL(web_contents).GetOrigin(); |
113 | 113 |
114 GURL embedding_origin = web_contents->GetLastCommittedURL().GetOrigin(); | 114 GURL embedding_origin = web_contents->GetLastCommittedURL().GetOrigin(); |
115 blink::mojom::PermissionStatus status = | 115 ContentSetting content_setting = |
116 PermissionManager::Get( | 116 PermissionManager::Get( |
117 Profile::FromBrowserContext(web_contents->GetBrowserContext())) | 117 Profile::FromBrowserContext(web_contents->GetBrowserContext())) |
118 ->GetPermissionStatus( | 118 ->GetPermissionStatus( |
119 CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER, | 119 CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER, |
120 requesting_origin, embedding_origin); | 120 requesting_origin, embedding_origin); |
121 | 121 |
122 return status == blink::mojom::PermissionStatus::GRANTED; | 122 return content_setting == CONTENT_SETTING_ALLOW; |
123 } | 123 } |
124 | 124 |
125 bool IsInSupportedMode(content::WebContents* web_contents) override { | 125 bool IsInSupportedMode(content::WebContents* web_contents) override { |
126 Profile* profile = | 126 Profile* profile = |
127 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | 127 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
128 if (profile->IsOffTheRecord() || profile->IsGuestSession()) | 128 if (profile->IsOffTheRecord() || profile->IsGuestSession()) |
129 return false; | 129 return false; |
130 | 130 |
131 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 131 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
132 return !command_line->HasSwitch(chromeos::switches::kSystemDevMode) || | 132 return !command_line->HasSwitch(chromeos::switches::kSystemDevMode) || |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 if (!operation_success) { | 428 if (!operation_success) { |
429 LOG(WARNING) << "PlatformVerificationFlow: Failed to renew platform " | 429 LOG(WARNING) << "PlatformVerificationFlow: Failed to renew platform " |
430 "certificate."; | 430 "certificate."; |
431 return; | 431 return; |
432 } | 432 } |
433 VLOG(1) << "Certificate successfully renewed."; | 433 VLOG(1) << "Certificate successfully renewed."; |
434 } | 434 } |
435 | 435 |
436 } // namespace attestation | 436 } // namespace attestation |
437 } // namespace chromeos | 437 } // namespace chromeos |
OLD | NEW |