| 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(sql::InitStatus init_status, |
| 67 ShowProfileErrorDialog( | 67 const std::string& diagnostics) { |
| 68 PROFILE_ERROR_HISTORY, | 68 ShowProfileErrorDialog(PROFILE_ERROR_HISTORY, |
| 69 (init_status == sql::INIT_FAILURE) ? | 69 (init_status == sql::INIT_FAILURE) |
| 70 IDS_COULDNT_OPEN_PROFILE_ERROR : IDS_PROFILE_TOO_NEW_ERROR); | 70 ? IDS_COULDNT_OPEN_PROFILE_ERROR |
| 71 : IDS_PROFILE_TOO_NEW_ERROR, |
| 72 diagnostics); |
| 71 } | 73 } |
| 72 | 74 |
| 73 std::unique_ptr<history::HistoryBackendClient> | 75 std::unique_ptr<history::HistoryBackendClient> |
| 74 ChromeHistoryClient::CreateBackendClient() { | 76 ChromeHistoryClient::CreateBackendClient() { |
| 75 return base::WrapUnique(new ChromeHistoryBackendClient(bookmark_model_)); | 77 return base::WrapUnique(new ChromeHistoryBackendClient(bookmark_model_)); |
| 76 } | 78 } |
| 77 | 79 |
| 78 void ChromeHistoryClient::BookmarkModelChanged() { | 80 void ChromeHistoryClient::BookmarkModelChanged() { |
| 79 } | 81 } |
| 80 | 82 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 91 } | 93 } |
| 92 | 94 |
| 93 void ChromeHistoryClient::BookmarkAllUserNodesRemoved( | 95 void ChromeHistoryClient::BookmarkAllUserNodesRemoved( |
| 94 bookmarks::BookmarkModel* bookmark_model, | 96 bookmarks::BookmarkModel* bookmark_model, |
| 95 const std::set<GURL>& removed_urls) { | 97 const std::set<GURL>& removed_urls) { |
| 96 BaseBookmarkModelObserver::BookmarkAllUserNodesRemoved(bookmark_model, | 98 BaseBookmarkModelObserver::BookmarkAllUserNodesRemoved(bookmark_model, |
| 97 removed_urls); | 99 removed_urls); |
| 98 DCHECK(!on_bookmarks_removed_.is_null()); | 100 DCHECK(!on_bookmarks_removed_.is_null()); |
| 99 on_bookmarks_removed_.Run(removed_urls); | 101 on_bookmarks_removed_.Run(removed_urls); |
| 100 } | 102 } |
| OLD | NEW |