| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Most of this code is copied from: | 5 // Most of this code is copied from: |
| 6 // src/chrome/browser/policy/asynchronous_policy_loader.{h,cc} | 6 // src/chrome/browser/policy/asynchronous_policy_loader.{h,cc} |
| 7 | 7 |
| 8 #include "remoting/host/plugin/policy_hack/nat_policy.h" | 8 #include "remoting/host/plugin/policy_hack/nat_policy.h" |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/location.h" |
| 13 #include "base/memory/weak_ptr.h" |
| 12 #include "base/message_loop_proxy.h" | 14 #include "base/message_loop_proxy.h" |
| 13 #include "base/memory/weak_ptr.h" | |
| 14 #include "base/synchronization/waitable_event.h" | 15 #include "base/synchronization/waitable_event.h" |
| 16 #include "base/time.h" |
| 15 #include "base/values.h" | 17 #include "base/values.h" |
| 16 | 18 |
| 17 namespace remoting { | 19 namespace remoting { |
| 18 namespace policy_hack { | 20 namespace policy_hack { |
| 19 | 21 |
| 20 namespace { | 22 namespace { |
| 21 // The time interval for rechecking policy. This is our fallback in case the | 23 // The time interval for rechecking policy. This is our fallback in case the |
| 22 // delegate never reports a change to the ReloadObserver. | 24 // delegate never reports a change to the ReloadObserver. |
| 23 const int kFallbackReloadDelayMinutes = 15; | 25 const int kFallbackReloadDelayMinutes = 15; |
| 24 | 26 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 if (!first_state_published_ || | 115 if (!first_state_published_ || |
| 114 (new_nat_enabled_state != current_nat_enabled_state_)) { | 116 (new_nat_enabled_state != current_nat_enabled_state_)) { |
| 115 first_state_published_ = true; | 117 first_state_published_ = true; |
| 116 current_nat_enabled_state_ = new_nat_enabled_state; | 118 current_nat_enabled_state_ = new_nat_enabled_state; |
| 117 nat_enabled_cb_.Run(current_nat_enabled_state_); | 119 nat_enabled_cb_.Run(current_nat_enabled_state_); |
| 118 } | 120 } |
| 119 } | 121 } |
| 120 | 122 |
| 121 } // namespace policy_hack | 123 } // namespace policy_hack |
| 122 } // namespace remoting | 124 } // namespace remoting |
| OLD | NEW |