| 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 "components/history/core/browser/typed_url_data_type_controller.h" | 5 #include "components/history/core/browser/typed_url_data_type_controller.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 std::unique_ptr<base::Closure> task_; | 45 std::unique_ptr<base::Closure> task_; |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 } // namespace | 48 } // namespace |
| 49 | 49 |
| 50 TypedUrlDataTypeController::TypedUrlDataTypeController( | 50 TypedUrlDataTypeController::TypedUrlDataTypeController( |
| 51 const base::Closure& dump_stack, | 51 const base::Closure& dump_stack, |
| 52 syncer::SyncClient* sync_client, | 52 syncer::SyncClient* sync_client, |
| 53 const char* history_disabled_pref_name) | 53 const char* history_disabled_pref_name) |
| 54 : NonUIDataTypeController(syncer::TYPED_URLS, | 54 : AsyncDirectoryTypeController(syncer::TYPED_URLS, |
| 55 dump_stack, | 55 dump_stack, |
| 56 sync_client, | 56 sync_client, |
| 57 syncer::GROUP_HISTORY, | 57 syncer::GROUP_HISTORY, |
| 58 nullptr), | 58 nullptr), |
| 59 history_disabled_pref_name_(history_disabled_pref_name), | 59 history_disabled_pref_name_(history_disabled_pref_name), |
| 60 sync_client_(sync_client) { | 60 sync_client_(sync_client) { |
| 61 pref_registrar_.Init(sync_client->GetPrefService()); | 61 pref_registrar_.Init(sync_client->GetPrefService()); |
| 62 pref_registrar_.Add( | 62 pref_registrar_.Add( |
| 63 history_disabled_pref_name_, | 63 history_disabled_pref_name_, |
| 64 base::Bind( | 64 base::Bind( |
| 65 &TypedUrlDataTypeController::OnSavingBrowserHistoryDisabledChanged, | 65 &TypedUrlDataTypeController::OnSavingBrowserHistoryDisabledChanged, |
| 66 base::AsWeakPtr(this))); | 66 base::AsWeakPtr(this))); |
| 67 } | 67 } |
| 68 | 68 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 } else { | 103 } else { |
| 104 // History must be disabled - don't start. | 104 // History must be disabled - don't start. |
| 105 LOG(WARNING) << "Cannot access history service - disabling typed url sync"; | 105 LOG(WARNING) << "Cannot access history service - disabling typed url sync"; |
| 106 return false; | 106 return false; |
| 107 } | 107 } |
| 108 } | 108 } |
| 109 | 109 |
| 110 TypedUrlDataTypeController::~TypedUrlDataTypeController() {} | 110 TypedUrlDataTypeController::~TypedUrlDataTypeController() {} |
| 111 | 111 |
| 112 } // namespace browser_sync | 112 } // namespace browser_sync |
| OLD | NEW |