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

Unified Diff: content/public/browser/devtools_target_descriptor.h

Issue 24995003: DevTools: Extract target discovery and manipulation from DevToolsHttpHandlerImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added Android implementations Created 7 years, 3 months 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: content/public/browser/devtools_target_descriptor.h
diff --git a/content/public/browser/devtools_target_descriptor.h b/content/public/browser/devtools_target_descriptor.h
new file mode 100644
index 0000000000000000000000000000000000000000..a46a0078f46bf0017e35478ece77b7ef23449139
--- /dev/null
+++ b/content/public/browser/devtools_target_descriptor.h
@@ -0,0 +1,68 @@
+// Copyright (c) 2013 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 CONTENT_PUBLIC_BROWSER_DEVTOOLS_TARGET_DESCRIPTOR_H_
+#define CONTENT_PUBLIC_BROWSER_DEVTOOLS_TARGET_DESCRIPTOR_H_
+
+#include <string>
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/time/time.h"
+#include "content/common/content_export.h"
+#include "content/public/browser/worker_service.h"
pfeldman 2013/09/30 12:25:46 Forward declaration should be enough.
+
+namespace base {
+class DictionaryValue;
+}
+
+namespace content {
+
+class WebContents;
+
+class CONTENT_EXPORT DevToolsTargetDescriptor {
pfeldman 2013/09/30 12:25:46 Why is this not a struct? It does not really need
+ public:
+ virtual ~DevToolsTargetDescriptor() {}
+
+ // Creates a descriptor for a target with valid WebContents.
+ static DevToolsTargetDescriptor* FromWebContents(WebContents* web_contents);
+
+ // Creates a descriptor for a shared worker.
+ static DevToolsTargetDescriptor* FromWorkerInfo(
pfeldman 2013/09/30 12:25:46 It is weird that content defers descriptor creatio
+ const WorkerService::WorkerInfo& worker);
+
+ // Returns the unique target id.
+ virtual std::string GetId() const = 0;
pfeldman 2013/09/30 12:25:46 Either DevToolsAgentHost or the descriptor needs t
+
+ // Returns the type string used by clients to group targets.
+ virtual std::string GetType() const = 0;
+
+ // Returns the title.
+ virtual std::string GetTitle() const = 0;
+
+ // Returns the description.
+ virtual std::string GetDescription() const = 0;
+
+ // Returns the url associated with this target.
+ virtual std::string GetUrl() const = 0;
+
+ // Returns the favicon url for this target.
+ virtual std::string GetFaviconUrl() const = 0;
+
+ // Returns the time when the target was last active.
+ virtual base::TimeTicks GetLastActivityTime() const = 0;
+
+ // Returns a dictionary value containing serialized target descriptor.
+ virtual base::DictionaryValue* Serialize() const = 0;
+
+ // Sets embedded-specific type.
+ virtual void OverrideType(const std::string& type) = 0;
+
+ // Sets embedded-specific description.
+ virtual void OverrideDescription(const std::string& description) = 0;
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_TARGET_DESCRIPTOR_H_

Powered by Google App Engine
This is Rietveld 408576698