Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: chrome/browser/devtools/devtools_targets_ui.h

Issue 65143004: DevTools: Refactor InspectUI class for extensibility (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/devtools/devtools_targets_ui.h
diff --git a/chrome/browser/devtools/devtools_targets_ui.h b/chrome/browser/devtools/devtools_targets_ui.h
new file mode 100644
index 0000000000000000000000000000000000000000..1ddbf6ac1b3d6f8763ee39fdc124a6a378e1bb58
--- /dev/null
+++ b/chrome/browser/devtools/devtools_targets_ui.h
@@ -0,0 +1,72 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
vsevik 2013/11/12 14:24:07 2013
Vladislav Kaznacheev 2013/11/13 16:02:33 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TARGETS_UI_H_
+#define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TARGETS_UI_H_
+
+#include <map>
+#include <string>
+
+#include "base/callback.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace base {
+class ListValue;
+class DictionaryValue;
+}
+
+class DevToolsTargetImpl;
+class Profile;
+
+class DevToolsTargetsUIHandler {
+ public:
+ typedef base::Callback<void(const std::string&,
+ scoped_ptr<base::ListValue>)> Callback;
+
+ DevToolsTargetsUIHandler(const std::string& source_id, Callback callback);
+ virtual ~DevToolsTargetsUIHandler();
+
+ std::string source_id() const { return source_id_; }
+
+ static scoped_ptr<DevToolsTargetsUIHandler> CreateForRenderers(
+ Callback callback);
+
+ static scoped_ptr<DevToolsTargetsUIHandler> CreateForWorkers(
+ Callback callback);
+
+ void Inspect(const std::string& target_id, Profile* profile);
+ void Activate(const std::string& target_id);
+ void Close(const std::string& target_id);
+ void Reload(const std::string& target_id);
+
+ protected:
+ base::DictionaryValue* Serialize(const DevToolsTargetImpl& target);
+ void SendSerializedTargets(scoped_ptr<base::ListValue> list);
+
+ typedef std::map<std::string, DevToolsTargetImpl*> TargetMap;
+ TargetMap targets_;
+
+ private:
+ const std::string source_id_;
+ Callback callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(DevToolsTargetsUIHandler);
+};
+
+class DevToolsRemoteTargetsUIHandler: public DevToolsTargetsUIHandler {
+ public:
+ DevToolsRemoteTargetsUIHandler(const std::string& source_id,
+ Callback callback);
+
+ static scoped_ptr<DevToolsRemoteTargetsUIHandler> CreateForAdb(
+ Callback callback, Profile* profile);
+
+ virtual void Open(const std::string& browser_id, const std::string& url) = 0;
+ virtual void Launch(const std::string& package_id) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DevToolsRemoteTargetsUIHandler);
+};
+
+#endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TARGETS_UI_H_

Powered by Google App Engine
This is Rietveld 408576698