| OLD | NEW |
| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 } | 81 } |
| 82 | 82 |
| 83 | 83 |
| 84 BookmarkModelSQLHandler::Task::~Task() { | 84 BookmarkModelSQLHandler::Task::~Task() { |
| 85 } | 85 } |
| 86 | 86 |
| 87 BookmarkModel* BookmarkModelSQLHandler::Task::GetBookmarkModel() { | 87 BookmarkModel* BookmarkModelSQLHandler::Task::GetBookmarkModel() { |
| 88 Profile* profile = ProfileManager::GetLastUsedProfile(); | 88 Profile* profile = ProfileManager::GetLastUsedProfile(); |
| 89 if (!profile) | 89 if (!profile) |
| 90 return NULL; | 90 return NULL; |
| 91 return BookmarkModelFactory::GetForProfile(profile); | 91 return BookmarkModelFactory::GetForBrowserContext(profile); |
| 92 } | 92 } |
| 93 | 93 |
| 94 BookmarkModelSQLHandler::BookmarkModelSQLHandler( | 94 BookmarkModelSQLHandler::BookmarkModelSQLHandler( |
| 95 URLDatabase* url_database) | 95 URLDatabase* url_database) |
| 96 : SQLHandler(kInterestingColumns, arraysize(kInterestingColumns)), | 96 : SQLHandler(kInterestingColumns, arraysize(kInterestingColumns)), |
| 97 url_database_(url_database) { | 97 url_database_(url_database) { |
| 98 } | 98 } |
| 99 | 99 |
| 100 BookmarkModelSQLHandler::~BookmarkModelSQLHandler() { | 100 BookmarkModelSQLHandler::~BookmarkModelSQLHandler() { |
| 101 } | 101 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( | 167 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( |
| 168 &BookmarkModelSQLHandler::Task::AddBookmarkToMobileFolder, | 168 &BookmarkModelSQLHandler::Task::AddBookmarkToMobileFolder, |
| 169 scoped_refptr<BookmarkModelSQLHandler::Task>( | 169 scoped_refptr<BookmarkModelSQLHandler::Task>( |
| 170 new BookmarkModelSQLHandler::Task()), | 170 new BookmarkModelSQLHandler::Task()), |
| 171 row->url(), row->title())); | 171 row->url(), row->title())); |
| 172 } | 172 } |
| 173 return true; | 173 return true; |
| 174 } | 174 } |
| 175 | 175 |
| 176 } // namespace history | 176 } // namespace history |
| OLD | NEW |