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

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: Replace in .mm files 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 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 bool ChromeBrowserProvider::RegisterChromeBrowserProvider(JNIEnv* env) { 818 bool ChromeBrowserProvider::RegisterChromeBrowserProvider(JNIEnv* env) {
819 return RegisterNativesImpl(env); 819 return RegisterNativesImpl(env);
820 } 820 }
821 821
822 ChromeBrowserProvider::ChromeBrowserProvider(JNIEnv* env, jobject obj) 822 ChromeBrowserProvider::ChromeBrowserProvider(JNIEnv* env, jobject obj)
823 : weak_java_provider_(env, obj), 823 : weak_java_provider_(env, obj),
824 history_service_observer_(this), 824 history_service_observer_(this),
825 handling_extensive_changes_(false) { 825 handling_extensive_changes_(false) {
826 DCHECK_CURRENTLY_ON(BrowserThread::UI); 826 DCHECK_CURRENTLY_ON(BrowserThread::UI);
827 profile_ = g_browser_process->profile_manager()->GetLastUsedProfile(); 827 profile_ = g_browser_process->profile_manager()->GetLastUsedProfile();
828 bookmark_model_ = BookmarkModelFactory::GetForProfile(profile_); 828 bookmark_model_ = BookmarkModelFactory::GetForBrowserContext(profile_);
829 top_sites_ = TopSitesFactory::GetForProfile(profile_); 829 top_sites_ = TopSitesFactory::GetForProfile(profile_);
830 favicon_service_ = FaviconServiceFactory::GetForProfile( 830 favicon_service_ = FaviconServiceFactory::GetForProfile(
831 profile_, ServiceAccessType::EXPLICIT_ACCESS), 831 profile_, ServiceAccessType::EXPLICIT_ACCESS),
832 service_.reset(new AndroidHistoryProviderService(profile_)); 832 service_.reset(new AndroidHistoryProviderService(profile_));
833 833
834 // Register as observer for service we are interested. 834 // Register as observer for service we are interested.
835 bookmark_model_->AddObserver(this); 835 bookmark_model_->AddObserver(this);
836 history_service_observer_.Add(HistoryServiceFactory::GetForProfile( 836 history_service_observer_.Add(HistoryServiceFactory::GetForProfile(
837 profile_, ServiceAccessType::EXPLICIT_ACCESS)); 837 profile_, ServiceAccessType::EXPLICIT_ACCESS));
838 TemplateURLService* template_service = 838 TemplateURLService* template_service =
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1214 ScopedJavaLocalRef<jobject> obj = weak_java_provider_.get(env); 1214 ScopedJavaLocalRef<jobject> obj = weak_java_provider_.get(env);
1215 if (obj.is_null()) 1215 if (obj.is_null())
1216 return; 1216 return;
1217 Java_ChromeBrowserProvider_onSearchTermChanged(env, obj.obj()); 1217 Java_ChromeBrowserProvider_onSearchTermChanged(env, obj.obj());
1218 } 1218 }
1219 1219
1220 void ChromeBrowserProvider::OnKeywordSearchTermDeleted( 1220 void ChromeBrowserProvider::OnKeywordSearchTermDeleted(
1221 history::HistoryService* history_service, 1221 history::HistoryService* history_service,
1222 history::URLID url_id) { 1222 history::URLID url_id) {
1223 } 1223 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698