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

Side by Side Diff: chrome/browser/android/provider/chrome_browser_provider.cc

Issue 2216713002: Use BookmarkModelFactory::GetForBrowserContext everywhere (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bookmarks
Patch Set: Eliminate Profile::FromBrowserContext in some places Created 4 years, 4 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 #include "chrome/browser/android/provider/chrome_browser_provider.h" 5 #include "chrome/browser/android/provider/chrome_browser_provider.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <list> 10 #include <list>
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 bool ChromeBrowserProvider::RegisterChromeBrowserProvider(JNIEnv* env) { 817 bool ChromeBrowserProvider::RegisterChromeBrowserProvider(JNIEnv* env) {
818 return RegisterNativesImpl(env); 818 return RegisterNativesImpl(env);
819 } 819 }
820 820
821 ChromeBrowserProvider::ChromeBrowserProvider(JNIEnv* env, jobject obj) 821 ChromeBrowserProvider::ChromeBrowserProvider(JNIEnv* env, jobject obj)
822 : weak_java_provider_(env, obj), 822 : weak_java_provider_(env, obj),
823 history_service_observer_(this), 823 history_service_observer_(this),
824 handling_extensive_changes_(false) { 824 handling_extensive_changes_(false) {
825 DCHECK_CURRENTLY_ON(BrowserThread::UI); 825 DCHECK_CURRENTLY_ON(BrowserThread::UI);
826 profile_ = g_browser_process->profile_manager()->GetLastUsedProfile(); 826 profile_ = g_browser_process->profile_manager()->GetLastUsedProfile();
827 bookmark_model_ = BookmarkModelFactory::GetForProfile(profile_); 827 bookmark_model_ = BookmarkModelFactory::GetForBrowserContext(profile_);
828 top_sites_ = TopSitesFactory::GetForProfile(profile_); 828 top_sites_ = TopSitesFactory::GetForProfile(profile_);
829 favicon_service_ = FaviconServiceFactory::GetForProfile( 829 favicon_service_ = FaviconServiceFactory::GetForProfile(
830 profile_, ServiceAccessType::EXPLICIT_ACCESS), 830 profile_, ServiceAccessType::EXPLICIT_ACCESS),
831 service_.reset(new AndroidHistoryProviderService(profile_)); 831 service_.reset(new AndroidHistoryProviderService(profile_));
832 832
833 // Register as observer for service we are interested. 833 // Register as observer for service we are interested.
834 bookmark_model_->AddObserver(this); 834 bookmark_model_->AddObserver(this);
835 history_service_observer_.Add(HistoryServiceFactory::GetForProfile( 835 history_service_observer_.Add(HistoryServiceFactory::GetForProfile(
836 profile_, ServiceAccessType::EXPLICIT_ACCESS)); 836 profile_, ServiceAccessType::EXPLICIT_ACCESS));
837 TemplateURLService* template_service = 837 TemplateURLService* template_service =
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 ScopedJavaLocalRef<jobject> obj = weak_java_provider_.get(env); 1213 ScopedJavaLocalRef<jobject> obj = weak_java_provider_.get(env);
1214 if (obj.is_null()) 1214 if (obj.is_null())
1215 return; 1215 return;
1216 Java_ChromeBrowserProvider_onSearchTermChanged(env, obj.obj()); 1216 Java_ChromeBrowserProvider_onSearchTermChanged(env, obj.obj());
1217 } 1217 }
1218 1218
1219 void ChromeBrowserProvider::OnKeywordSearchTermDeleted( 1219 void ChromeBrowserProvider::OnKeywordSearchTermDeleted(
1220 history::HistoryService* history_service, 1220 history::HistoryService* history_service,
1221 history::URLID url_id) { 1221 history::URLID url_id) {
1222 } 1222 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698