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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 protected: | 42 protected: |
43 ~RunTaskOnHistoryThread() override {} | 43 ~RunTaskOnHistoryThread() override {} |
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 sync_driver::SyncClient* sync_client, |
53 const char* history_disabled_pref_name) | 53 const char* history_disabled_pref_name) |
54 : NonUIDataTypeController(syncer::TYPED_URLS, dump_stack, sync_client), | 54 : NonUIDataTypeController(syncer::TYPED_URLS, dump_stack, sync_client), |
55 history_disabled_pref_name_(history_disabled_pref_name), | 55 history_disabled_pref_name_(history_disabled_pref_name), |
56 sync_client_(sync_client) { | 56 sync_client_(sync_client) { |
57 pref_registrar_.Init(sync_client->GetPrefService()); | 57 pref_registrar_.Init(sync_client->GetPrefService()); |
58 pref_registrar_.Add( | 58 pref_registrar_.Add( |
59 history_disabled_pref_name_, | 59 history_disabled_pref_name_, |
60 base::Bind( | 60 base::Bind( |
61 &TypedUrlDataTypeController::OnSavingBrowserHistoryDisabledChanged, | 61 &TypedUrlDataTypeController::OnSavingBrowserHistoryDisabledChanged, |
62 base::AsWeakPtr(this))); | 62 base::AsWeakPtr(this))); |
(...skipping 40 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 |