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

Unified Diff: chrome/browser/ui/google_now/google_now_service.h

Issue 11434116: Geolocation request for Google Now (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebasing Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/google_now/google_now_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/google_now/google_now_service.h
diff --git a/chrome/browser/ui/google_now/google_now_service.h b/chrome/browser/ui/google_now/google_now_service.h
index eb6459a237b7f5270292c57c1c5778184776bb53..2fca48247cd9b92d405a3d38f943bd26081c561d 100644
--- a/chrome/browser/ui/google_now/google_now_service.h
+++ b/chrome/browser/ui/google_now/google_now_service.h
@@ -52,8 +52,10 @@ class GoogleNowService : public ProfileKeyedService {
// Starts obtaining location of the machine.
void StartObtainingGeolocation();
void OnLocationObtained(const content::Geoposition& position);
+ void OnLocationRequestTimeout();
- // Starts downloading cards from the server.
+ // Starts downloading cards from the server. If the position's Validate() call
bulach 2012/12/10 14:25:46 nit: not sure if the last bit add much in here :)
vadimt 2012/12/10 19:09:08 Done.
+ // returns false, this means that the position is not available.
void StartServerRequest(const content::Geoposition& position);
void OnServerRequestCompleted(net::URLRequest* request, int num_bytes);
@@ -69,6 +71,11 @@ class GoogleNowService : public ProfileKeyedService {
Profile* const profile_;
// Timer to schedule next cards update.
base::OneShotTimer<GoogleNowService> next_update_timer_;
+ // Timer to cancel geolocation requests that take too long.
+ base::OneShotTimer<GoogleNowService> geolocation_request_timer_;
+ // Weak factory for the geolocation request callback. Used to ensure
+ // geolocation request callback is not run after this object is destroyed.
+ base::WeakPtrFactory<GoogleNowService> geolocation_request_weak_factory_;
John Knottenbelt 2012/12/10 14:30:58 nit: I read this as "a factory that hands out weak
vadimt 2012/12/10 19:09:08 Probably, we'll have other weak pointers here, for
DISALLOW_COPY_AND_ASSIGN(GoogleNowService);
};
« no previous file with comments | « no previous file | chrome/browser/ui/google_now/google_now_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698