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

Side by Side Diff: chrome/browser/history/history.cc

Issue 10392084: WIP for integration between Chrome and Google Web History. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More work. 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/history/history.h ('k') | chrome/browser/history/web_history_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // The history system runs on a background thread so that potentially slow 5 // The history system runs on a background thread so that potentially slow
6 // database operations don't delay the browser. This backend processing is 6 // database operations don't delay the browser. This backend processing is
7 // represented by HistoryBackend. The HistoryService's job is to dispatch to 7 // represented by HistoryBackend. The HistoryService's job is to dispatch to
8 // that thread. 8 // that thread.
9 // 9 //
10 // Main thread History thread 10 // Main thread History thread
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 bookmark_service_)); 860 bookmark_service_));
861 history_backend_.swap(backend); 861 history_backend_.swap(backend);
862 862
863 // There may not be a profile when unit testing. 863 // There may not be a profile when unit testing.
864 std::string languages; 864 std::string languages;
865 if (profile_) { 865 if (profile_) {
866 PrefService* prefs = profile_->GetPrefs(); 866 PrefService* prefs = profile_->GetPrefs();
867 languages = prefs->GetString(prefs::kAcceptLanguages); 867 languages = prefs->GetString(prefs::kAcceptLanguages);
868 } 868 }
869 ScheduleAndForget(PRIORITY_UI, &HistoryBackend::Init, languages, no_db_); 869 ScheduleAndForget(PRIORITY_UI, &HistoryBackend::Init, languages, no_db_);
870
871 // Create a WebHistoryService instance for this profile. This is used to
872 // fetch visits from other devices from Google Web History.
873 history::WebHistoryService::GetForProfile(profile_);
870 } 874 }
871 875
872 void HistoryService::OnDBLoaded(int backend_id) { 876 void HistoryService::OnDBLoaded(int backend_id) {
873 if (!history_backend_ || current_backend_id_ != backend_id) { 877 if (!history_backend_ || current_backend_id_ != backend_id) {
874 VLOG(1) << "Message from obsolete backend"; 878 VLOG(1) << "Message from obsolete backend";
875 return; 879 return;
876 } 880 }
877 backend_loaded_ = true; 881 backend_loaded_ = true;
878 content::NotificationService::current()->Notify( 882 content::NotificationService::current()->Notify(
879 chrome::NOTIFICATION_HISTORY_LOADED, 883 chrome::NOTIFICATION_HISTORY_LOADED,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 void HistoryService::RemoveVisitDatabaseObserver( 918 void HistoryService::RemoveVisitDatabaseObserver(
915 history::VisitDatabaseObserver* observer) { 919 history::VisitDatabaseObserver* observer) {
916 visit_database_observers_->RemoveObserver(observer); 920 visit_database_observers_->RemoveObserver(observer);
917 } 921 }
918 922
919 void HistoryService::NotifyVisitDBObserversOnAddVisit( 923 void HistoryService::NotifyVisitDBObserversOnAddVisit(
920 const history::BriefVisitInfo& info) { 924 const history::BriefVisitInfo& info) {
921 visit_database_observers_->Notify( 925 visit_database_observers_->Notify(
922 &history::VisitDatabaseObserver::OnAddVisit, info); 926 &history::VisitDatabaseObserver::OnAddVisit, info);
923 } 927 }
OLDNEW
« no previous file with comments | « chrome/browser/history/history.h ('k') | chrome/browser/history/web_history_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698