| 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 <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 // We need to track which infobars were closed. | 55 // We need to track which infobars were closed. |
| 56 class ClosedInfoBarTracker : public content::NotificationObserver { | 56 class ClosedInfoBarTracker : public content::NotificationObserver { |
| 57 public: | 57 public: |
| 58 ClosedInfoBarTracker(); | 58 ClosedInfoBarTracker(); |
| 59 virtual ~ClosedInfoBarTracker(); | 59 virtual ~ClosedInfoBarTracker(); |
| 60 | 60 |
| 61 // content::NotificationObserver: | 61 // content::NotificationObserver: |
| 62 virtual void Observe(int type, | 62 virtual void Observe(int type, |
| 63 const content::NotificationSource& source, | 63 const content::NotificationSource& source, |
| 64 const content::NotificationDetails& details) OVERRIDE; | 64 const content::NotificationDetails& details) override; |
| 65 | 65 |
| 66 size_t size() const { return removed_infobars_.size(); } | 66 size_t size() const { return removed_infobars_.size(); } |
| 67 | 67 |
| 68 bool Contains(infobars::InfoBar* infobar) const; | 68 bool Contains(infobars::InfoBar* infobar) const; |
| 69 void Clear(); | 69 void Clear(); |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 FRIEND_TEST_ALL_PREFIXES(GeolocationPermissionContextTests, TabDestroyed); | 72 FRIEND_TEST_ALL_PREFIXES(GeolocationPermissionContextTests, TabDestroyed); |
| 73 content::NotificationRegistrar registrar_; | 73 content::NotificationRegistrar registrar_; |
| 74 std::set<infobars::InfoBar*> removed_infobars_; | 74 std::set<infobars::InfoBar*> removed_infobars_; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 99 removed_infobars_.clear(); | 99 removed_infobars_.clear(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 | 102 |
| 103 // GeolocationPermissionContextTests ------------------------------------------ | 103 // GeolocationPermissionContextTests ------------------------------------------ |
| 104 | 104 |
| 105 class GeolocationPermissionContextTests | 105 class GeolocationPermissionContextTests |
| 106 : public ChromeRenderViewHostTestHarness { | 106 : public ChromeRenderViewHostTestHarness { |
| 107 protected: | 107 protected: |
| 108 // ChromeRenderViewHostTestHarness: | 108 // ChromeRenderViewHostTestHarness: |
| 109 virtual void SetUp() OVERRIDE; | 109 virtual void SetUp() override; |
| 110 virtual void TearDown() OVERRIDE; | 110 virtual void TearDown() override; |
| 111 | 111 |
| 112 PermissionRequestID RequestID(int bridge_id); | 112 PermissionRequestID RequestID(int bridge_id); |
| 113 PermissionRequestID RequestIDForTab(int tab, int bridge_id); | 113 PermissionRequestID RequestIDForTab(int tab, int bridge_id); |
| 114 InfoBarService* infobar_service() { | 114 InfoBarService* infobar_service() { |
| 115 return InfoBarService::FromWebContents(web_contents()); | 115 return InfoBarService::FromWebContents(web_contents()); |
| 116 } | 116 } |
| 117 InfoBarService* infobar_service_for_tab(int tab) { | 117 InfoBarService* infobar_service_for_tab(int tab) { |
| 118 return InfoBarService::FromWebContents(extra_tabs_[tab]); | 118 return InfoBarService::FromWebContents(extra_tabs_[tab]); |
| 119 } | 119 } |
| 120 | 120 |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 // it is the embedder. | 775 // it is the embedder. |
| 776 EXPECT_EQ(map->GetLastUsage(requesting_frame_0.GetOrigin(), | 776 EXPECT_EQ(map->GetLastUsage(requesting_frame_0.GetOrigin(), |
| 777 requesting_frame_0.GetOrigin(), | 777 requesting_frame_0.GetOrigin(), |
| 778 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), | 778 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), |
| 779 13); | 779 13); |
| 780 EXPECT_EQ(map->GetLastUsage(requesting_frame_1.GetOrigin(), | 780 EXPECT_EQ(map->GetLastUsage(requesting_frame_1.GetOrigin(), |
| 781 requesting_frame_0.GetOrigin(), | 781 requesting_frame_0.GetOrigin(), |
| 782 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), | 782 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), |
| 783 11); | 783 11); |
| 784 } | 784 } |
| OLD | NEW |