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 12 matching lines...) Expand all Loading... |
23 #include "chromeos/chromeos_switches.h" | 23 #include "chromeos/chromeos_switches.h" |
24 #include "chromeos/cryptohome/async_method_caller.h" | 24 #include "chromeos/cryptohome/async_method_caller.h" |
25 #include "chromeos/cryptohome/cryptohome_parameters.h" | 25 #include "chromeos/cryptohome/cryptohome_parameters.h" |
26 #include "chromeos/dbus/cryptohome_client.h" | 26 #include "chromeos/dbus/cryptohome_client.h" |
27 #include "chromeos/dbus/dbus_thread_manager.h" | 27 #include "chromeos/dbus/dbus_thread_manager.h" |
28 #include "components/content_settings/core/browser/host_content_settings_map.h" | 28 #include "components/content_settings/core/browser/host_content_settings_map.h" |
29 #include "components/content_settings/core/common/content_settings_pattern.h" | 29 #include "components/content_settings/core/common/content_settings_pattern.h" |
30 #include "components/user_manager/user.h" | 30 #include "components/user_manager/user.h" |
31 #include "content/public/browser/browser_context.h" | 31 #include "content/public/browser/browser_context.h" |
32 #include "content/public/browser/browser_thread.h" | 32 #include "content/public/browser/browser_thread.h" |
33 #include "content/public/browser/permission_type.h" | |
34 #include "content/public/browser/render_process_host.h" | 33 #include "content/public/browser/render_process_host.h" |
35 #include "content/public/browser/render_view_host.h" | 34 #include "content/public/browser/render_view_host.h" |
36 #include "content/public/browser/user_metrics.h" | 35 #include "content/public/browser/user_metrics.h" |
37 #include "content/public/browser/web_contents.h" | 36 #include "content/public/browser/web_contents.h" |
38 #include "content/public/common/url_constants.h" | 37 #include "content/public/common/url_constants.h" |
39 #include "net/cert/pem_tokenizer.h" | 38 #include "net/cert/pem_tokenizer.h" |
40 #include "net/cert/x509_certificate.h" | 39 #include "net/cert/x509_certificate.h" |
41 #include "third_party/WebKit/public/platform/modules/permissions/permission_stat
us.mojom.h" | 40 #include "third_party/WebKit/public/platform/modules/permissions/permission_stat
us.mojom.h" |
42 | 41 |
43 namespace { | 42 namespace { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 // TODO(xhwang): Using delegate_->GetURL() here is not right. The platform | 108 // TODO(xhwang): Using delegate_->GetURL() here is not right. The platform |
110 // verification may be requested by a frame from a different origin. This | 109 // verification may be requested by a frame from a different origin. This |
111 // will be solved when http://crbug.com/454847 is fixed. | 110 // will be solved when http://crbug.com/454847 is fixed. |
112 const GURL& requesting_origin = GetURL(web_contents).GetOrigin(); | 111 const GURL& requesting_origin = GetURL(web_contents).GetOrigin(); |
113 | 112 |
114 GURL embedding_origin = web_contents->GetLastCommittedURL().GetOrigin(); | 113 GURL embedding_origin = web_contents->GetLastCommittedURL().GetOrigin(); |
115 blink::mojom::PermissionStatus status = | 114 blink::mojom::PermissionStatus status = |
116 PermissionManager::Get( | 115 PermissionManager::Get( |
117 Profile::FromBrowserContext(web_contents->GetBrowserContext())) | 116 Profile::FromBrowserContext(web_contents->GetBrowserContext())) |
118 ->GetPermissionStatus( | 117 ->GetPermissionStatus( |
119 content::PermissionType::PROTECTED_MEDIA_IDENTIFIER, | 118 CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER, |
120 requesting_origin, embedding_origin); | 119 requesting_origin, embedding_origin); |
121 | 120 |
122 return status == blink::mojom::PermissionStatus::GRANTED; | 121 return status == blink::mojom::PermissionStatus::GRANTED; |
123 } | 122 } |
124 | 123 |
125 bool IsInSupportedMode(content::WebContents* web_contents) override { | 124 bool IsInSupportedMode(content::WebContents* web_contents) override { |
126 Profile* profile = | 125 Profile* profile = |
127 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | 126 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
128 if (profile->IsOffTheRecord() || profile->IsGuestSession()) | 127 if (profile->IsOffTheRecord() || profile->IsGuestSession()) |
129 return false; | 128 return false; |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 if (!operation_success) { | 427 if (!operation_success) { |
429 LOG(WARNING) << "PlatformVerificationFlow: Failed to renew platform " | 428 LOG(WARNING) << "PlatformVerificationFlow: Failed to renew platform " |
430 "certificate."; | 429 "certificate."; |
431 return; | 430 return; |
432 } | 431 } |
433 VLOG(1) << "Certificate successfully renewed."; | 432 VLOG(1) << "Certificate successfully renewed."; |
434 } | 433 } |
435 | 434 |
436 } // namespace attestation | 435 } // namespace attestation |
437 } // namespace chromeos | 436 } // namespace chromeos |
OLD | NEW |