| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/geolocation/geolocation_permission_context.h" | 5 #include "chrome/browser/geolocation/geolocation_permission_context.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 | 309 |
| 310 #if !BUILDFLAG(ANDROID_JAVA_UI) | 310 #if !BUILDFLAG(ANDROID_JAVA_UI) |
| 311 void GeolocationPermissionContextTests::SetupRequestManager( | 311 void GeolocationPermissionContextTests::SetupRequestManager( |
| 312 content::WebContents* web_contents) { | 312 content::WebContents* web_contents) { |
| 313 // Create PermissionRequestManager. | 313 // Create PermissionRequestManager. |
| 314 PermissionRequestManager::CreateForWebContents(web_contents); | 314 PermissionRequestManager::CreateForWebContents(web_contents); |
| 315 PermissionRequestManager* permission_request_manager = | 315 PermissionRequestManager* permission_request_manager = |
| 316 PermissionRequestManager::FromWebContents(web_contents); | 316 PermissionRequestManager::FromWebContents(web_contents); |
| 317 | 317 |
| 318 // Create a MockPermissionPromptFactory for the PermissionRequestManager. | 318 // Create a MockPermissionPromptFactory for the PermissionRequestManager. |
| 319 mock_permission_prompt_factories_.push_back(base::WrapUnique( | 319 mock_permission_prompt_factories_.push_back( |
| 320 new MockPermissionPromptFactory(permission_request_manager))); | 320 base::MakeUnique<MockPermissionPromptFactory>( |
| 321 permission_request_manager)); |
| 321 | 322 |
| 322 // Prepare the PermissionRequestManager to display a mock bubble. | 323 // Prepare the PermissionRequestManager to display a mock bubble. |
| 323 permission_request_manager->DisplayPendingRequests(); | 324 permission_request_manager->DisplayPendingRequests(); |
| 324 } | 325 } |
| 325 | 326 |
| 326 size_t GeolocationPermissionContextTests::GetBubblesQueueSize( | 327 size_t GeolocationPermissionContextTests::GetBubblesQueueSize( |
| 327 PermissionRequestManager* manager) { | 328 PermissionRequestManager* manager) { |
| 328 return manager->requests_.size(); | 329 return manager->requests_.size(); |
| 329 } | 330 } |
| 330 | 331 |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 999 // it is the embedder. | 1000 // it is the embedder. |
| 1000 EXPECT_EQ(map->GetLastUsage(requesting_frame_0.GetOrigin(), | 1001 EXPECT_EQ(map->GetLastUsage(requesting_frame_0.GetOrigin(), |
| 1001 requesting_frame_0.GetOrigin(), | 1002 requesting_frame_0.GetOrigin(), |
| 1002 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), | 1003 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), |
| 1003 13); | 1004 13); |
| 1004 EXPECT_EQ(map->GetLastUsage(requesting_frame_1.GetOrigin(), | 1005 EXPECT_EQ(map->GetLastUsage(requesting_frame_1.GetOrigin(), |
| 1005 requesting_frame_0.GetOrigin(), | 1006 requesting_frame_0.GetOrigin(), |
| 1006 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), | 1007 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), |
| 1007 11); | 1008 11); |
| 1008 } | 1009 } |
| OLD | NEW |