| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chrome_history_client.h" | 5 #include "chrome/browser/history/chrome_history_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 } | 63 } |
| 64 | 64 |
| 65 void ChromeHistoryClient::NotifyProfileError(sql::InitStatus init_status, | 65 void ChromeHistoryClient::NotifyProfileError(sql::InitStatus init_status, |
| 66 const std::string& diagnostics) { | 66 const std::string& diagnostics) { |
| 67 ShowProfileErrorDialog(PROFILE_ERROR_HISTORY, | 67 ShowProfileErrorDialog(PROFILE_ERROR_HISTORY, |
| 68 SqlInitStatusToMessageId(init_status), diagnostics); | 68 SqlInitStatusToMessageId(init_status), diagnostics); |
| 69 } | 69 } |
| 70 | 70 |
| 71 std::unique_ptr<history::HistoryBackendClient> | 71 std::unique_ptr<history::HistoryBackendClient> |
| 72 ChromeHistoryClient::CreateBackendClient() { | 72 ChromeHistoryClient::CreateBackendClient() { |
| 73 return base::WrapUnique(new ChromeHistoryBackendClient(bookmark_model_)); | 73 return base::MakeUnique<ChromeHistoryBackendClient>(bookmark_model_); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void ChromeHistoryClient::BookmarkModelChanged() { | 76 void ChromeHistoryClient::BookmarkModelChanged() { |
| 77 } | 77 } |
| 78 | 78 |
| 79 void ChromeHistoryClient::BookmarkNodeRemoved( | 79 void ChromeHistoryClient::BookmarkNodeRemoved( |
| 80 bookmarks::BookmarkModel* bookmark_model, | 80 bookmarks::BookmarkModel* bookmark_model, |
| 81 const bookmarks::BookmarkNode* parent, | 81 const bookmarks::BookmarkNode* parent, |
| 82 int old_index, | 82 int old_index, |
| 83 const bookmarks::BookmarkNode* node, | 83 const bookmarks::BookmarkNode* node, |
| 84 const std::set<GURL>& removed_urls) { | 84 const std::set<GURL>& removed_urls) { |
| 85 BaseBookmarkModelObserver::BookmarkNodeRemoved(bookmark_model, parent, | 85 BaseBookmarkModelObserver::BookmarkNodeRemoved(bookmark_model, parent, |
| 86 old_index, node, removed_urls); | 86 old_index, node, removed_urls); |
| 87 DCHECK(!on_bookmarks_removed_.is_null()); | 87 DCHECK(!on_bookmarks_removed_.is_null()); |
| 88 on_bookmarks_removed_.Run(removed_urls); | 88 on_bookmarks_removed_.Run(removed_urls); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void ChromeHistoryClient::BookmarkAllUserNodesRemoved( | 91 void ChromeHistoryClient::BookmarkAllUserNodesRemoved( |
| 92 bookmarks::BookmarkModel* bookmark_model, | 92 bookmarks::BookmarkModel* bookmark_model, |
| 93 const std::set<GURL>& removed_urls) { | 93 const std::set<GURL>& removed_urls) { |
| 94 BaseBookmarkModelObserver::BookmarkAllUserNodesRemoved(bookmark_model, | 94 BaseBookmarkModelObserver::BookmarkAllUserNodesRemoved(bookmark_model, |
| 95 removed_urls); | 95 removed_urls); |
| 96 DCHECK(!on_bookmarks_removed_.is_null()); | 96 DCHECK(!on_bookmarks_removed_.is_null()); |
| 97 on_bookmarks_removed_.Run(removed_urls); | 97 on_bookmarks_removed_.Run(removed_urls); |
| 98 } | 98 } |
| OLD | NEW |