| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 on_bookmarks_removed_.Reset(); | 56 on_bookmarks_removed_.Reset(); |
| 57 } | 57 } |
| 58 bookmark_model_->Shutdown(); | 58 bookmark_model_->Shutdown(); |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 | 61 |
| 62 bool ChromeHistoryClient::CanAddURL(const GURL& url) { | 62 bool ChromeHistoryClient::CanAddURL(const GURL& url) { |
| 63 return CanAddURLToHistory(url); | 63 return CanAddURLToHistory(url); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void ChromeHistoryClient::NotifyProfileError(sql::InitStatus init_status) { | 66 void ChromeHistoryClient::NotifyProfileError( |
| 67 ShowProfileErrorDialog( | 67 sql::InitStatus init_status, |
| 68 PROFILE_ERROR_HISTORY, | 68 const sql::DatabaseDiagnosticMap& diagnostics) { |
| 69 (init_status == sql::INIT_FAILURE) ? | 69 ShowProfileErrorDialog(PROFILE_ERROR_HISTORY, |
| 70 IDS_COULDNT_OPEN_PROFILE_ERROR : IDS_PROFILE_TOO_NEW_ERROR); | 70 (init_status == sql::INIT_FAILURE) |
| 71 ? IDS_COULDNT_OPEN_PROFILE_ERROR |
| 72 : IDS_PROFILE_TOO_NEW_ERROR, |
| 73 diagnostics); |
| 71 } | 74 } |
| 72 | 75 |
| 73 std::unique_ptr<history::HistoryBackendClient> | 76 std::unique_ptr<history::HistoryBackendClient> |
| 74 ChromeHistoryClient::CreateBackendClient() { | 77 ChromeHistoryClient::CreateBackendClient() { |
| 75 return base::WrapUnique(new ChromeHistoryBackendClient(bookmark_model_)); | 78 return base::WrapUnique(new ChromeHistoryBackendClient(bookmark_model_)); |
| 76 } | 79 } |
| 77 | 80 |
| 78 void ChromeHistoryClient::BookmarkModelChanged() { | 81 void ChromeHistoryClient::BookmarkModelChanged() { |
| 79 } | 82 } |
| 80 | 83 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 91 } | 94 } |
| 92 | 95 |
| 93 void ChromeHistoryClient::BookmarkAllUserNodesRemoved( | 96 void ChromeHistoryClient::BookmarkAllUserNodesRemoved( |
| 94 bookmarks::BookmarkModel* bookmark_model, | 97 bookmarks::BookmarkModel* bookmark_model, |
| 95 const std::set<GURL>& removed_urls) { | 98 const std::set<GURL>& removed_urls) { |
| 96 BaseBookmarkModelObserver::BookmarkAllUserNodesRemoved(bookmark_model, | 99 BaseBookmarkModelObserver::BookmarkAllUserNodesRemoved(bookmark_model, |
| 97 removed_urls); | 100 removed_urls); |
| 98 DCHECK(!on_bookmarks_removed_.is_null()); | 101 DCHECK(!on_bookmarks_removed_.is_null()); |
| 99 on_bookmarks_removed_.Run(removed_urls); | 102 on_bookmarks_removed_.Run(removed_urls); |
| 100 } | 103 } |
| OLD | NEW |