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

Side by Side Diff: chrome/browser/android/omnibox/autocomplete_controller_android.cc

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "chrome/browser/android/omnibox/autocomplete_controller_android.h" 5 #include "chrome/browser/android/omnibox/autocomplete_controller_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 explicit ZeroSuggestPrefetcher(Profile* profile); 73 explicit ZeroSuggestPrefetcher(Profile* profile);
74 74
75 private: 75 private:
76 ~ZeroSuggestPrefetcher() override; 76 ~ZeroSuggestPrefetcher() override;
77 void SelfDestruct(); 77 void SelfDestruct();
78 78
79 // AutocompleteControllerDelegate: 79 // AutocompleteControllerDelegate:
80 void OnResultChanged(bool default_match_changed) override; 80 void OnResultChanged(bool default_match_changed) override;
81 81
82 scoped_ptr<AutocompleteController> controller_; 82 scoped_ptr<AutocompleteController> controller_;
83 base::OneShotTimer<ZeroSuggestPrefetcher> expire_timer_; 83 base::OneShotTimer expire_timer_;
84 }; 84 };
85 85
86 ZeroSuggestPrefetcher::ZeroSuggestPrefetcher(Profile* profile) 86 ZeroSuggestPrefetcher::ZeroSuggestPrefetcher(Profile* profile)
87 : controller_(new AutocompleteController( 87 : controller_(new AutocompleteController(
88 make_scoped_ptr(new ChromeAutocompleteProviderClient(profile)), 88 make_scoped_ptr(new ChromeAutocompleteProviderClient(profile)),
89 this, 89 this,
90 AutocompleteProvider::TYPE_ZERO_SUGGEST)) { 90 AutocompleteProvider::TYPE_ZERO_SUGGEST)) {
91 // Creating an arbitrary fake_request_source to avoid passing in an invalid 91 // Creating an arbitrary fake_request_source to avoid passing in an invalid
92 // AutocompleteInput object. 92 // AutocompleteInput object.
93 base::string16 fake_request_source(base::ASCIIToUTF16( 93 base::string16 fake_request_source(base::ASCIIToUTF16(
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 return; 561 return;
562 562
563 // ZeroSuggestPrefetcher deletes itself after it's done prefetching. 563 // ZeroSuggestPrefetcher deletes itself after it's done prefetching.
564 new ZeroSuggestPrefetcher(profile); 564 new ZeroSuggestPrefetcher(profile);
565 } 565 }
566 566
567 // Register native methods 567 // Register native methods
568 bool RegisterAutocompleteControllerAndroid(JNIEnv* env) { 568 bool RegisterAutocompleteControllerAndroid(JNIEnv* env) {
569 return RegisterNativesImpl(env); 569 return RegisterNativesImpl(env);
570 } 570 }
OLDNEW
« no previous file with comments | « chrome/browser/android/feedback/connectivity_checker.cc ('k') | chrome/browser/apps/drive/drive_app_provider_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698