| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 3110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3121 | 3121 |
| 3122 class MediaStreamDevicesControllerBrowserTest | 3122 class MediaStreamDevicesControllerBrowserTest |
| 3123 : public PolicyTest, | 3123 : public PolicyTest, |
| 3124 public testing::WithParamInterface<bool> { | 3124 public testing::WithParamInterface<bool> { |
| 3125 public: | 3125 public: |
| 3126 // TODO(raymes): When crbug.com/606138 is finished and the | 3126 // TODO(raymes): When crbug.com/606138 is finished and the |
| 3127 // PermissionRequestManager is used to show all prompts on Android/Desktop | 3127 // PermissionRequestManager is used to show all prompts on Android/Desktop |
| 3128 // we should remove PermissionPromptDelegate and just use | 3128 // we should remove PermissionPromptDelegate and just use |
| 3129 // MockPermissionPromptFactory instead. The APIs are the same. | 3129 // MockPermissionPromptFactory instead. The APIs are the same. |
| 3130 class TestPermissionPromptDelegate | 3130 class TestPermissionPromptDelegate |
| 3131 : public ::internal::PermissionPromptDelegate { | 3131 : public MediaStreamDevicesController::PermissionPromptDelegate { |
| 3132 public: | 3132 public: |
| 3133 void ShowPrompt( | 3133 void ShowPrompt(bool user_gesture, |
| 3134 bool user_gesture, | 3134 content::WebContents* web_contents, |
| 3135 content::WebContents* web_contents, | 3135 std::unique_ptr<MediaStreamDevicesController::Request> |
| 3136 std::unique_ptr<MediaStreamDevicesController> controller) override { | 3136 request) override { |
| 3137 if (response_type_ == PermissionRequestManager::ACCEPT_ALL) | 3137 if (response_type_ == PermissionRequestManager::ACCEPT_ALL) |
| 3138 controller->PermissionGranted(); | 3138 request->PermissionGranted(); |
| 3139 else if (response_type_ == PermissionRequestManager::DENY_ALL) | 3139 else if (response_type_ == PermissionRequestManager::DENY_ALL) |
| 3140 controller->PermissionDenied(); | 3140 request->PermissionDenied(); |
| 3141 } | 3141 } |
| 3142 | 3142 |
| 3143 void set_response_type( | 3143 void set_response_type( |
| 3144 PermissionRequestManager::AutoResponseType response_type) { | 3144 PermissionRequestManager::AutoResponseType response_type) { |
| 3145 response_type_ = response_type; | 3145 response_type_ = response_type; |
| 3146 } | 3146 } |
| 3147 | 3147 |
| 3148 private: | 3148 private: |
| 3149 PermissionRequestManager::AutoResponseType response_type_ = | 3149 PermissionRequestManager::AutoResponseType response_type_ = |
| 3150 PermissionRequestManager::NONE; | 3150 PermissionRequestManager::NONE; |
| (...skipping 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4485 | 4485 |
| 4486 SetEmptyPolicy(); | 4486 SetEmptyPolicy(); |
| 4487 // Policy not set. | 4487 // Policy not set. |
| 4488 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); | 4488 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); |
| 4489 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); | 4489 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); |
| 4490 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); | 4490 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); |
| 4491 } | 4491 } |
| 4492 #endif // defined(OS_CHROMEOS) | 4492 #endif // defined(OS_CHROMEOS) |
| 4493 | 4493 |
| 4494 } // namespace policy | 4494 } // namespace policy |
| OLD | NEW |