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

Side by Side Diff: content/browser/geolocation/geolocation_observer.h

Issue 10344004: Add content API for requesting the current geolocation (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: *Argh*, missed another forward declaration of a struct as a class. Created 8 years, 7 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 #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
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_
OLDNEW
« no previous file with comments | « content/browser/geolocation/geolocation.cc ('k') | content/browser/geolocation/geolocation_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698