Chromium Code Reviews| 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_ |