Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: content/browser/geolocation/mock_location_provider.cc

Issue 631053003: Replacing the OVERRIDE with override and FINAL with final in content/browser/geolocation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolved mac issue Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 position_.accuracy = 3; 79 position_.accuracy = 3;
80 position_.latitude = 4.3; 80 position_.latitude = 4.3;
81 position_.longitude = -7.8; 81 position_.longitude = -7.8;
82 // Webkit compares the timestamp to wall clock time, so we need it to be 82 // Webkit compares the timestamp to wall clock time, so we need it to be
83 // contemporary. 83 // contemporary.
84 position_.timestamp = base::Time::Now(); 84 position_.timestamp = base::Time::Now();
85 } else { 85 } else {
86 position_.error_code = Geoposition::ERROR_CODE_POSITION_UNAVAILABLE; 86 position_.error_code = Geoposition::ERROR_CODE_POSITION_UNAVAILABLE;
87 } 87 }
88 } 88 }
89 virtual bool StartProvider(bool high_accuracy) OVERRIDE { 89 virtual bool StartProvider(bool high_accuracy) override {
90 MockLocationProvider::StartProvider(high_accuracy); 90 MockLocationProvider::StartProvider(high_accuracy);
91 if (!requires_permission_to_start_) { 91 if (!requires_permission_to_start_) {
92 UpdateListenersIfNeeded(); 92 UpdateListenersIfNeeded();
93 } 93 }
94 return true; 94 return true;
95 } 95 }
96 96
97 virtual void OnPermissionGranted() OVERRIDE { 97 virtual void OnPermissionGranted() override {
98 MockLocationProvider::OnPermissionGranted(); 98 MockLocationProvider::OnPermissionGranted();
99 if (requires_permission_to_start_) { 99 if (requires_permission_to_start_) {
100 UpdateListenersIfNeeded(); 100 UpdateListenersIfNeeded();
101 } 101 }
102 } 102 }
103 103
104 void UpdateListenersIfNeeded() { 104 void UpdateListenersIfNeeded() {
105 if (!listeners_updated_) { 105 if (!listeners_updated_) {
106 listeners_updated_ = true; 106 listeners_updated_ = true;
107 base::MessageLoop::current()->PostTask( 107 base::MessageLoop::current()->PostTask(
(...skipping 19 matching lines...) Expand all
127 127
128 LocationProvider* NewAutoFailMockLocationProvider() { 128 LocationProvider* NewAutoFailMockLocationProvider() {
129 return new AutoMockLocationProvider(false, false); 129 return new AutoMockLocationProvider(false, false);
130 } 130 }
131 131
132 LocationProvider* NewAutoSuccessMockNetworkLocationProvider() { 132 LocationProvider* NewAutoSuccessMockNetworkLocationProvider() {
133 return new AutoMockLocationProvider(true, true); 133 return new AutoMockLocationProvider(true, true);
134 } 134 }
135 135
136 } // namespace content 136 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/geolocation/mock_location_provider.h ('k') | content/browser/geolocation/network_location_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698