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 #ifndef CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_H_ |
6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 11 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "base/memory/singleton.h" | 12 #include "base/memory/singleton.h" |
12 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
13 #include "content/public/browser/devtools_manager_delegate.h" | 14 #include "content/public/browser/devtools_manager_delegate.h" |
14 | 15 |
15 namespace content { | 16 namespace content { |
16 | 17 |
17 class DevToolsAgentHostImpl; | 18 class DevToolsAgentHostImpl; |
18 | 19 |
19 // This class is a singleton that manage global DevTools state for the whole | 20 // This class is a singleton that manage global DevTools state for the whole |
20 // browser. | 21 // browser. |
21 // TODO(dgozman): remove this class entirely. | 22 // TODO(dgozman): remove this class entirely. |
22 class CONTENT_EXPORT DevToolsManager { | 23 class CONTENT_EXPORT DevToolsManager { |
23 public: | 24 public: |
24 // Returns single instance of this class. The instance is destroyed on the | 25 // Returns single instance of this class. The instance is destroyed on the |
25 // browser main loop exit so this method MUST NOT be called after that point. | 26 // browser main loop exit so this method MUST NOT be called after that point. |
26 static DevToolsManager* GetInstance(); | 27 static DevToolsManager* GetInstance(); |
27 | 28 |
28 DevToolsManager(); | 29 DevToolsManager(); |
29 virtual ~DevToolsManager(); | 30 virtual ~DevToolsManager(); |
30 | 31 |
31 DevToolsManagerDelegate* delegate() const { return delegate_.get(); } | 32 DevToolsManagerDelegate* delegate() const { return delegate_.get(); } |
32 | 33 |
33 void AgentHostStateChanged(DevToolsAgentHostImpl* agent_host, bool attached); | 34 void AgentHostStateChanged(DevToolsAgentHostImpl* agent_host, bool attached); |
34 | 35 |
35 private: | 36 private: |
36 friend struct base::DefaultSingletonTraits<DevToolsManager>; | 37 friend struct base::DefaultSingletonTraits<DevToolsManager>; |
37 | 38 |
38 scoped_ptr<DevToolsManagerDelegate> delegate_; | 39 std::unique_ptr<DevToolsManagerDelegate> delegate_; |
39 int attached_hosts_count_; | 40 int attached_hosts_count_; |
40 | 41 |
41 DISALLOW_COPY_AND_ASSIGN(DevToolsManager); | 42 DISALLOW_COPY_AND_ASSIGN(DevToolsManager); |
42 }; | 43 }; |
43 | 44 |
44 } // namespace content | 45 } // namespace content |
45 | 46 |
46 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_H_ | 47 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_H_ |
OLD | NEW |