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

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

Issue 10843018: Removing instances of profile_->GetBookmarkModel() as part of converting BookmarkModel to a PKS. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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 | Annotate | Revision Log
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/history/android/bookmark_model_sql_handler.h" 5 #include "chrome/browser/history/android/bookmark_model_sql_handler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/bookmarks/bookmark_model.h" 8 #include "chrome/browser/bookmarks/bookmark_model.h"
9 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
9 #include "chrome/browser/bookmarks/bookmark_service.h" 10 #include "chrome/browser/bookmarks/bookmark_service.h"
10 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
11 #include "chrome/browser/history/url_database.h" 12 #include "chrome/browser/history/url_database.h"
12 #include "chrome/browser/profiles/profile_manager.h" 13 #include "chrome/browser/profiles/profile_manager.h"
13 #include "content/public/browser/browser_thread.h" 14 #include "content/public/browser/browser_thread.h"
14 15
15 using base::Time; 16 using base::Time;
16 using content::BrowserThread; 17 using content::BrowserThread;
17 18
18 namespace history { 19 namespace history {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 78 }
78 79
79 80
80 BookmarkModelSQLHandler::Task::~Task() { 81 BookmarkModelSQLHandler::Task::~Task() {
81 } 82 }
82 83
83 BookmarkModel* BookmarkModelSQLHandler::Task::GetBookmarkModel() { 84 BookmarkModel* BookmarkModelSQLHandler::Task::GetBookmarkModel() {
84 Profile* profile = ProfileManager::GetLastUsedProfile(); 85 Profile* profile = ProfileManager::GetLastUsedProfile();
85 if (!profile) 86 if (!profile)
86 return NULL; 87 return NULL;
87 return profile->GetBookmarkModel(); 88 return BookmarkModelFactory::GetForProfile(profile);
88 } 89 }
89 90
90 BookmarkModelSQLHandler::BookmarkModelSQLHandler( 91 BookmarkModelSQLHandler::BookmarkModelSQLHandler(
91 URLDatabase* url_database) 92 URLDatabase* url_database)
92 : SQLHandler(kInterestingColumns, arraysize(kInterestingColumns)), 93 : SQLHandler(kInterestingColumns, arraysize(kInterestingColumns)),
93 url_database_(url_database) { 94 url_database_(url_database) {
94 } 95 }
95 96
96 BookmarkModelSQLHandler::~BookmarkModelSQLHandler() { 97 BookmarkModelSQLHandler::~BookmarkModelSQLHandler() {
97 } 98 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( 164 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(
164 &BookmarkModelSQLHandler::Task::AddBookmarkToMobileFolder, 165 &BookmarkModelSQLHandler::Task::AddBookmarkToMobileFolder,
165 scoped_refptr<BookmarkModelSQLHandler::Task>( 166 scoped_refptr<BookmarkModelSQLHandler::Task>(
166 new BookmarkModelSQLHandler::Task()), 167 new BookmarkModelSQLHandler::Task()),
167 row->url(), row->title())); 168 row->url(), row->title()));
168 } 169 }
169 return true; 170 return true;
170 } 171 }
171 172
172 } // namespace history. 173 } // namespace history.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698