OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CHROME_BROWSER_PREVIEWS_PREVIEWS_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_PREVIEWS_PREVIEWS_SERVICE_H_ |
6 #define CHROME_BROWSER_PREVIEWS_PREVIEWS_SERVICE_H_ | 6 #define CHROME_BROWSER_PREVIEWS_PREVIEWS_SERVICE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/ref_counted.h" | |
12 #include "base/single_thread_task_runner.h" | |
11 #include "components/keyed_service/core/keyed_service.h" | 13 #include "components/keyed_service/core/keyed_service.h" |
12 | 14 |
15 namespace base { | |
16 class FilePath; | |
17 } | |
18 | |
13 namespace previews { | 19 namespace previews { |
20 class PreviewsIOData; | |
14 class PreviewsUIService; | 21 class PreviewsUIService; |
15 } | 22 } |
16 | 23 |
17 // Keyed service that owns a previews::PreviewsUIService. PreviewsService lives | 24 // Keyed service that owns a previews::PreviewsUIService. PreviewsService lives |
18 // on the UI thread. | 25 // on the UI thread. |
19 class PreviewsService : public KeyedService { | 26 class PreviewsService : public KeyedService { |
20 public: | 27 public: |
21 PreviewsService(); | 28 PreviewsService(); |
22 ~PreviewsService() override; | 29 ~PreviewsService() override; |
23 | 30 |
24 // The previews UI thread service. | 31 // Initializes the UI Service. |
tbansal1
2016/10/04 15:01:21
Say something about the function arguments.
RyanSturm
2016/10/04 19:10:23
Done.
| |
25 void set_previews_ui_service( | 32 void Initialize( |
26 std::unique_ptr<previews::PreviewsUIService> previews_ui_service); | 33 previews::PreviewsIOData* previews_io_data, |
34 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, | |
35 const base::FilePath& profile_path); | |
36 | |
27 previews::PreviewsUIService* previews_ui_service() { | 37 previews::PreviewsUIService* previews_ui_service() { |
28 return previews_ui_service_.get(); | 38 return previews_ui_service_.get(); |
29 } | 39 } |
30 | 40 |
31 private: | 41 private: |
32 // The previews UI thread service. | 42 // The previews UI thread service. |
33 std::unique_ptr<previews::PreviewsUIService> previews_ui_service_; | 43 std::unique_ptr<previews::PreviewsUIService> previews_ui_service_; |
34 | 44 |
35 DISALLOW_COPY_AND_ASSIGN(PreviewsService); | 45 DISALLOW_COPY_AND_ASSIGN(PreviewsService); |
36 }; | 46 }; |
37 | 47 |
38 #endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_SERVICE_H_ | 48 #endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_SERVICE_H_ |
OLD | NEW |