| 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> |
| 11 #include <utility> | 11 #include <utility> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/bind.h" | 14 #include "base/bind.h" |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "base/containers/hash_tables.h" | 16 #include "base/containers/hash_tables.h" |
| 17 #include "base/gtest_prod_util.h" | 17 #include "base/gtest_prod_util.h" |
| 18 #include "base/id_map.h" | 18 #include "base/id_map.h" |
| 19 #include "base/memory/ptr_util.h" | 19 #include "base/memory/ptr_util.h" |
| 20 #include "base/synchronization/waitable_event.h" | 20 #include "base/synchronization/waitable_event.h" |
| 21 #include "base/test/simple_test_clock.h" | 21 #include "base/test/simple_test_clock.h" |
| 22 #include "base/time/clock.h" | 22 #include "base/time/clock.h" |
| 23 #include "chrome/browser/chrome_notification_types.h" | 23 #include "chrome/browser/chrome_notification_types.h" |
| 24 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 24 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 25 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 25 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 26 #include "chrome/browser/geolocation/geolocation_permission_context.h" | 26 #include "chrome/browser/geolocation/geolocation_permission_context.h" |
| 27 #include "chrome/browser/infobars/infobar_service.h" | 27 #include "chrome/browser/infobars/infobar_service.h" |
| 28 #include "chrome/browser/permissions/permission_context_base.h" | 28 #include "chrome/browser/permissions/permission_context_base.h" |
| 29 #include "chrome/browser/permissions/permission_manager.h" | 29 #include "chrome/browser/permissions/permission_manager.h" |
| 30 #include "chrome/browser/permissions/permission_request.h" |
| 30 #include "chrome/browser/permissions/permission_request_id.h" | 31 #include "chrome/browser/permissions/permission_request_id.h" |
| 31 #include "chrome/browser/ui/website_settings/permission_bubble_request.h" | |
| 32 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
| 33 #include "chrome/common/features.h" | 33 #include "chrome/common/features.h" |
| 34 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 34 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 35 #include "chrome/test/base/testing_profile.h" | 35 #include "chrome/test/base/testing_profile.h" |
| 36 #include "components/content_settings/core/browser/host_content_settings_map.h" | 36 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 37 #include "components/infobars/core/confirm_infobar_delegate.h" | 37 #include "components/infobars/core/confirm_infobar_delegate.h" |
| 38 #include "components/infobars/core/infobar.h" | 38 #include "components/infobars/core/infobar.h" |
| 39 #include "content/public/browser/browser_thread.h" | 39 #include "content/public/browser/browser_thread.h" |
| 40 #include "content/public/browser/navigation_details.h" | 40 #include "content/public/browser/navigation_details.h" |
| 41 #include "content/public/browser/navigation_entry.h" | 41 #include "content/public/browser/navigation_entry.h" |
| (...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 // it is the embedder. | 974 // it is the embedder. |
| 975 EXPECT_EQ(map->GetLastUsage(requesting_frame_0.GetOrigin(), | 975 EXPECT_EQ(map->GetLastUsage(requesting_frame_0.GetOrigin(), |
| 976 requesting_frame_0.GetOrigin(), | 976 requesting_frame_0.GetOrigin(), |
| 977 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), | 977 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), |
| 978 13); | 978 13); |
| 979 EXPECT_EQ(map->GetLastUsage(requesting_frame_1.GetOrigin(), | 979 EXPECT_EQ(map->GetLastUsage(requesting_frame_1.GetOrigin(), |
| 980 requesting_frame_0.GetOrigin(), | 980 requesting_frame_0.GetOrigin(), |
| 981 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), | 981 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), |
| 982 11); | 982 11); |
| 983 } | 983 } |
| OLD | NEW |