| 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 ChromeRenderViewHostTestHarness::SetUp(); | 281 ChromeRenderViewHostTestHarness::SetUp(); |
| 282 | 282 |
| 283 // Set up required helpers, and make this be as "tabby" as the code requires. | 283 // Set up required helpers, and make this be as "tabby" as the code requires. |
| 284 #if BUILDFLAG(ENABLE_EXTENSIONS) | 284 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 285 extensions::SetViewType(web_contents(), extensions::VIEW_TYPE_TAB_CONTENTS); | 285 extensions::SetViewType(web_contents(), extensions::VIEW_TYPE_TAB_CONTENTS); |
| 286 #endif | 286 #endif |
| 287 InfoBarService::CreateForWebContents(web_contents()); | 287 InfoBarService::CreateForWebContents(web_contents()); |
| 288 TabSpecificContentSettings::CreateForWebContents(web_contents()); | 288 TabSpecificContentSettings::CreateForWebContents(web_contents()); |
| 289 geolocation_permission_context_ = static_cast<GeolocationPermissionContext*>( | 289 geolocation_permission_context_ = static_cast<GeolocationPermissionContext*>( |
| 290 PermissionManager::Get(profile())->GetPermissionContext( | 290 PermissionManager::Get(profile())->GetPermissionContext( |
| 291 content::PermissionType::GEOLOCATION)); | 291 CONTENT_SETTINGS_TYPE_GEOLOCATION)); |
| 292 #if defined(OS_ANDROID) | 292 #if defined(OS_ANDROID) |
| 293 static_cast<GeolocationPermissionContextAndroid*>( | 293 static_cast<GeolocationPermissionContextAndroid*>( |
| 294 geolocation_permission_context_) | 294 geolocation_permission_context_) |
| 295 ->SetLocationSettingsForTesting( | 295 ->SetLocationSettingsForTesting( |
| 296 std::unique_ptr<LocationSettings>(new MockLocationSettings())); | 296 std::unique_ptr<LocationSettings>(new MockLocationSettings())); |
| 297 MockLocationSettings::SetLocationStatus(true, true); | 297 MockLocationSettings::SetLocationStatus(true, true); |
| 298 #else | 298 #else |
| 299 SetupRequestManager(web_contents()); | 299 SetupRequestManager(web_contents()); |
| 300 #endif | 300 #endif |
| 301 } | 301 } |
| (...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1001 // it is the embedder. | 1001 // it is the embedder. |
| 1002 EXPECT_EQ(map->GetLastUsage(requesting_frame_0.GetOrigin(), | 1002 EXPECT_EQ(map->GetLastUsage(requesting_frame_0.GetOrigin(), |
| 1003 requesting_frame_0.GetOrigin(), | 1003 requesting_frame_0.GetOrigin(), |
| 1004 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), | 1004 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), |
| 1005 13); | 1005 13); |
| 1006 EXPECT_EQ(map->GetLastUsage(requesting_frame_1.GetOrigin(), | 1006 EXPECT_EQ(map->GetLastUsage(requesting_frame_1.GetOrigin(), |
| 1007 requesting_frame_0.GetOrigin(), | 1007 requesting_frame_0.GetOrigin(), |
| 1008 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), | 1008 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), |
| 1009 11); | 1009 11); |
| 1010 } | 1010 } |
| OLD | NEW |