| 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 #include "chrome/browser/ui/extensions/application_launch.h" | 223 #include "chrome/browser/ui/extensions/application_launch.h" |
| 224 #include "extensions/browser/app_window/app_window.h" | 224 #include "extensions/browser/app_window/app_window.h" |
| 225 #include "extensions/browser/app_window/app_window_registry.h" | 225 #include "extensions/browser/app_window/app_window_registry.h" |
| 226 #include "extensions/browser/app_window/native_app_window.h" | 226 #include "extensions/browser/app_window/native_app_window.h" |
| 227 #include "ui/base/window_open_disposition.h" | 227 #include "ui/base/window_open_disposition.h" |
| 228 #endif | 228 #endif |
| 229 | 229 |
| 230 #if defined(ENABLE_MEDIA_ROUTER) && !defined(OS_ANDROID) | 230 #if defined(ENABLE_MEDIA_ROUTER) && !defined(OS_ANDROID) |
| 231 #include "chrome/browser/ui/toolbar/component_toolbar_actions_factory.h" | 231 #include "chrome/browser/ui/toolbar/component_toolbar_actions_factory.h" |
| 232 #include "chrome/browser/ui/toolbar/media_router_action_controller.h" | 232 #include "chrome/browser/ui/toolbar/media_router_action_controller.h" |
| 233 #include "chrome/browser/ui/toolbar/toolbar_actions_model.h" |
| 233 #endif // defined(ENABLE_MEDIA_ROUTER) && !defined(OS_ANDROID) | 234 #endif // defined(ENABLE_MEDIA_ROUTER) && !defined(OS_ANDROID) |
| 234 | 235 |
| 235 using content::BrowserThread; | 236 using content::BrowserThread; |
| 236 using net::URLRequestMockHTTPJob; | 237 using net::URLRequestMockHTTPJob; |
| 237 using testing::Mock; | 238 using testing::Mock; |
| 238 using testing::Return; | 239 using testing::Return; |
| 239 using testing::_; | 240 using testing::_; |
| 240 | 241 |
| 241 namespace policy { | 242 namespace policy { |
| 242 | 243 |
| (...skipping 3363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3606 PolicyMap policies; | 3607 PolicyMap policies; |
| 3607 policies.Set(key::kShowCastIconInToolbar, POLICY_LEVEL_MANDATORY, | 3608 policies.Set(key::kShowCastIconInToolbar, POLICY_LEVEL_MANDATORY, |
| 3608 POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, | 3609 POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, |
| 3609 base::MakeUnique<base::FundamentalValue>(enable), nullptr); | 3610 base::MakeUnique<base::FundamentalValue>(enable), nullptr); |
| 3610 provider_.UpdateChromePolicy(policies); | 3611 provider_.UpdateChromePolicy(policies); |
| 3611 } | 3612 } |
| 3612 | 3613 |
| 3613 protected: | 3614 protected: |
| 3614 bool HasMediaRouterActionAtInit() const { | 3615 bool HasMediaRouterActionAtInit() const { |
| 3615 const std::set<std::string>& component_ids = | 3616 const std::set<std::string>& component_ids = |
| 3616 ComponentToolbarActionsFactory::GetInstance()->GetInitialComponentIds( | 3617 ToolbarActionsModel::Get(browser()->profile()) |
| 3617 browser()->profile()); | 3618 ->component_actions_factory() |
| 3619 ->GetInitialComponentIds(); |
| 3620 |
| 3618 return base::ContainsKey( | 3621 return base::ContainsKey( |
| 3619 component_ids, ComponentToolbarActionsFactory::kMediaRouterActionId); | 3622 component_ids, ComponentToolbarActionsFactory::kMediaRouterActionId); |
| 3620 } | 3623 } |
| 3621 }; | 3624 }; |
| 3622 | 3625 |
| 3623 using MediaRouterActionEnabledPolicyTest = MediaRouterActionPolicyTest<true>; | 3626 using MediaRouterActionEnabledPolicyTest = MediaRouterActionPolicyTest<true>; |
| 3624 using MediaRouterActionDisabledPolicyTest = MediaRouterActionPolicyTest<false>; | 3627 using MediaRouterActionDisabledPolicyTest = MediaRouterActionPolicyTest<false>; |
| 3625 | 3628 |
| 3626 IN_PROC_BROWSER_TEST_F(MediaRouterActionEnabledPolicyTest, | 3629 IN_PROC_BROWSER_TEST_F(MediaRouterActionEnabledPolicyTest, |
| 3627 MediaRouterActionEnabled) { | 3630 MediaRouterActionEnabled) { |
| (...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4410 | 4413 |
| 4411 SetEmptyPolicy(); | 4414 SetEmptyPolicy(); |
| 4412 // Policy not set. | 4415 // Policy not set. |
| 4413 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); | 4416 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); |
| 4414 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); | 4417 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); |
| 4415 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); | 4418 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); |
| 4416 } | 4419 } |
| 4417 #endif // defined(OS_CHROMEOS) | 4420 #endif // defined(OS_CHROMEOS) |
| 4418 | 4421 |
| 4419 } // namespace policy | 4422 } // namespace policy |
| OLD | NEW |