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 #ifndef CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_OBSERVER_H_ | 5 #ifndef CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_OBSERVER_H_ |
6 #define CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_OBSERVER_H_ | 6 #define CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_OBSERVER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 template <typename MAP> | 41 template <typename MAP> |
42 static GeolocationObserverOptions Collapse(const MAP& options_map) { | 42 static GeolocationObserverOptions Collapse(const MAP& options_map) { |
43 for (typename MAP::const_iterator it = options_map.begin(); | 43 for (typename MAP::const_iterator it = options_map.begin(); |
44 it != options_map.end(); ++it) { | 44 it != options_map.end(); ++it) { |
45 if (it->second.use_high_accuracy) | 45 if (it->second.use_high_accuracy) |
46 return GeolocationObserverOptions(true); | 46 return GeolocationObserverOptions(true); |
47 } | 47 } |
48 return GeolocationObserverOptions(false); | 48 return GeolocationObserverOptions(false); |
49 } | 49 } |
50 | 50 |
| 51 // Collapse options with another instance so that both are satisfied. |
| 52 void Collapse(const GeolocationObserverOptions& other) { |
| 53 use_high_accuracy = use_high_accuracy | other.use_high_accuracy; |
| 54 } |
| 55 |
51 bool use_high_accuracy; | 56 bool use_high_accuracy; |
52 }; | 57 }; |
53 | 58 |
54 #endif // CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_OBSERVER_H_ | 59 #endif // CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_OBSERVER_H_ |
OLD | NEW |