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

Side by Side Diff: chrome/browser/android/bookmarks/bookmark_bridge.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
« no previous file with comments | « no previous file | chrome/browser/android/bookmarks/partner_bookmarks_shim_unittest.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/bookmarks/bookmark_bridge.h" 5 #include "chrome/browser/android/bookmarks/bookmark_bridge.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 } // namespace 95 } // namespace
96 96
97 BookmarkBridge::BookmarkBridge(JNIEnv* env, jobject obj, jobject j_profile) 97 BookmarkBridge::BookmarkBridge(JNIEnv* env, jobject obj, jobject j_profile)
98 : weak_java_ref_(env, obj), 98 : weak_java_ref_(env, obj),
99 bookmark_model_(NULL), 99 bookmark_model_(NULL),
100 managed_bookmark_service_(NULL), 100 managed_bookmark_service_(NULL),
101 partner_bookmarks_shim_(NULL) { 101 partner_bookmarks_shim_(NULL) {
102 DCHECK_CURRENTLY_ON(BrowserThread::UI); 102 DCHECK_CURRENTLY_ON(BrowserThread::UI);
103 profile_ = ProfileAndroid::FromProfileAndroid(j_profile); 103 profile_ = ProfileAndroid::FromProfileAndroid(j_profile);
104 bookmark_model_ = BookmarkModelFactory::GetForProfile(profile_); 104 bookmark_model_ = BookmarkModelFactory::GetForBrowserContext(profile_);
105 managed_bookmark_service_ = 105 managed_bookmark_service_ =
106 ManagedBookmarkServiceFactory::GetForProfile(profile_); 106 ManagedBookmarkServiceFactory::GetForProfile(profile_);
107 107
108 // Registers the notifications we are interested. 108 // Registers the notifications we are interested.
109 bookmark_model_->AddObserver(this); 109 bookmark_model_->AddObserver(this);
110 110
111 // Create the partner Bookmarks shim as early as possible (but don't attach). 111 // Create the partner Bookmarks shim as early as possible (but don't attach).
112 partner_bookmarks_shim_ = PartnerBookmarksShim::BuildForBrowserContext( 112 partner_bookmarks_shim_ = PartnerBookmarksShim::BuildForBrowserContext(
113 chrome::GetBrowserContextRedirectedInIncognito(profile_)); 113 chrome::GetBrowserContextRedirectedInIncognito(profile_));
114 partner_bookmarks_shim_->AddObserver(this); 114 partner_bookmarks_shim_->AddObserver(this);
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 BookmarkModelChanged(); 1109 BookmarkModelChanged();
1110 } 1110 }
1111 1111
1112 void BookmarkBridge::PartnerShimLoaded(PartnerBookmarksShim* shim) { 1112 void BookmarkBridge::PartnerShimLoaded(PartnerBookmarksShim* shim) {
1113 NotifyIfDoneLoading(); 1113 NotifyIfDoneLoading();
1114 } 1114 }
1115 1115
1116 void BookmarkBridge::ShimBeingDeleted(PartnerBookmarksShim* shim) { 1116 void BookmarkBridge::ShimBeingDeleted(PartnerBookmarksShim* shim) {
1117 partner_bookmarks_shim_ = NULL; 1117 partner_bookmarks_shim_ = NULL;
1118 } 1118 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/bookmarks/partner_bookmarks_shim_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698