summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/glue/search_engine_data_type_controller.h
blob: 2985888e2985a7d4a5c38a4330ce1d6aacf29d05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_SYNC_GLUE_SEARCH_ENGINE_DATA_TYPE_CONTROLLER_H__
#define CHROME_BROWSER_SYNC_GLUE_SEARCH_ENGINE_DATA_TYPE_CONTROLLER_H__

#include <string>

#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "components/search_engines/template_url_service.h"
#include "components/sync_driver/generic_change_processor.h"
#include "components/sync_driver/ui_data_type_controller.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"

class Profile;

namespace browser_sync {

class SearchEngineDataTypeController
    : public sync_driver::UIDataTypeController {
 public:
  SearchEngineDataTypeController(
      sync_driver::SyncApiComponentFactory* profile_sync_factory,
      Profile* profile);

  TemplateURLService::Subscription* GetSubscriptionForTesting();

 private:
  virtual ~SearchEngineDataTypeController();

  // FrontendDataTypeController implementations.
  virtual bool StartModels() override;
  virtual void StopModels() override;

  void OnTemplateURLServiceLoaded();

  scoped_ptr<TemplateURLService::Subscription> template_url_subscription_;
  Profile* const profile_;

  DISALLOW_COPY_AND_ASSIGN(SearchEngineDataTypeController);
};

}  // namespace browser_sync

#endif  // CHROME_BROWSER_SYNC_GLUE_SEARCH_ENGINE_DATA_TYPE_CONTROLLER_H__