1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TARGETS_UI_H_
6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TARGETS_UI_H_
11 #include "base/callback.h"
12 #include "base/memory/scoped_ptr.h"
16 class DictionaryValue
;
19 class DevToolsTargetImpl
;
22 class DevToolsTargetsUIHandler
{
24 typedef base::Callback
<void(const std::string
&,
25 scoped_ptr
<base::ListValue
>)> Callback
;
27 DevToolsTargetsUIHandler(const std::string
& source_id
, Callback callback
);
28 virtual ~DevToolsTargetsUIHandler();
30 std::string
source_id() const { return source_id_
; }
32 static scoped_ptr
<DevToolsTargetsUIHandler
> CreateForRenderers(
35 static scoped_ptr
<DevToolsTargetsUIHandler
> CreateForWorkers(
38 void Inspect(const std::string
& target_id
, Profile
* profile
);
39 void Activate(const std::string
& target_id
);
40 void Close(const std::string
& target_id
);
41 void Reload(const std::string
& target_id
);
44 base::DictionaryValue
* Serialize(const DevToolsTargetImpl
& target
);
45 void SendSerializedTargets(scoped_ptr
<base::ListValue
> list
);
47 typedef std::map
<std::string
, DevToolsTargetImpl
*> TargetMap
;
51 const std::string source_id_
;
54 DISALLOW_COPY_AND_ASSIGN(DevToolsTargetsUIHandler
);
57 class DevToolsRemoteTargetsUIHandler
: public DevToolsTargetsUIHandler
{
59 DevToolsRemoteTargetsUIHandler(const std::string
& source_id
,
62 static scoped_ptr
<DevToolsRemoteTargetsUIHandler
> CreateForAdb(
63 Callback callback
, Profile
* profile
);
65 virtual void Open(const std::string
& browser_id
, const std::string
& url
) = 0;
68 DISALLOW_COPY_AND_ASSIGN(DevToolsRemoteTargetsUIHandler
);
71 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TARGETS_UI_H_