| 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 // This file implements a mock location provider and the factory functions for | 5 // This file implements a mock location provider and the factory functions for |
| 6 // various ways of creating it. | 6 // various ways of creating it. |
| 7 | 7 |
| 8 #include "content/browser/geolocation/mock_location_provider.h" | 8 #include "content/browser/geolocation/mock_location_provider.h" |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
| 16 #include "base/message_loop_proxy.h" | 16 #include "base/message_loop/message_loop_proxy.h" |
| 17 | 17 |
| 18 namespace content { | 18 namespace content { |
| 19 MockLocationProvider* MockLocationProvider::instance_ = NULL; | 19 MockLocationProvider* MockLocationProvider::instance_ = NULL; |
| 20 | 20 |
| 21 MockLocationProvider::MockLocationProvider(MockLocationProvider** self_ref) | 21 MockLocationProvider::MockLocationProvider(MockLocationProvider** self_ref) |
| 22 : state_(STOPPED), | 22 : state_(STOPPED), |
| 23 is_permission_granted_(false), | 23 is_permission_granted_(false), |
| 24 self_ref_(self_ref), | 24 self_ref_(self_ref), |
| 25 provider_loop_(base::MessageLoopProxy::current()) { | 25 provider_loop_(base::MessageLoopProxy::current()) { |
| 26 CHECK(self_ref_); | 26 CHECK(self_ref_); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 127 |
| 128 LocationProviderBase* NewAutoFailMockLocationProvider() { | 128 LocationProviderBase* NewAutoFailMockLocationProvider() { |
| 129 return new AutoMockLocationProvider(false, false); | 129 return new AutoMockLocationProvider(false, false); |
| 130 } | 130 } |
| 131 | 131 |
| 132 LocationProviderBase* NewAutoSuccessMockNetworkLocationProvider() { | 132 LocationProviderBase* NewAutoSuccessMockNetworkLocationProvider() { |
| 133 return new AutoMockLocationProvider(true, true); | 133 return new AutoMockLocationProvider(true, true); |
| 134 } | 134 } |
| 135 | 135 |
| 136 } // namespace content | 136 } // namespace content |
| OLD | NEW |