Don't preload rarely seen large images
[chromium-blink-merge.git] / components / devtools_discovery / basic_target_descriptor.h
bloba3b834a7e3ad0747d303468db03fb082b26a8a1e
1 // Copyright 2015 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 COMPONENTS_DEVTOOLS_DISCOVERY_BASIC_TARGET_DESCRIPTOR_H_
6 #define COMPONENTS_DEVTOOLS_DISCOVERY_BASIC_TARGET_DESCRIPTOR_H_
8 #include "components/devtools_discovery/devtools_target_descriptor.h"
10 namespace devtools_discovery {
12 class BasicTargetDescriptor : public DevToolsTargetDescriptor {
13 public:
14 explicit BasicTargetDescriptor(
15 scoped_refptr<content::DevToolsAgentHost> agent_host);
16 ~BasicTargetDescriptor() override;
18 static const char kTypePage[];
19 static const char kTypeServiceWorker[];
20 static const char kTypeSharedWorker[];
21 static const char kTypeOther[];
23 // DevToolsTargetDescriptor implementation.
24 std::string GetId() const override;
25 std::string GetParentId() const override;
26 std::string GetType() const override;
27 std::string GetTitle() const override;
28 std::string GetDescription() const override;
29 GURL GetURL() const override;
30 GURL GetFaviconURL() const override;
31 base::TimeTicks GetLastActivityTime() const override;
32 bool IsAttached() const override;
33 scoped_refptr<content::DevToolsAgentHost> GetAgentHost() const override;
34 bool Activate() const override;
35 bool Close() const override;
37 protected:
38 void set_parent_id(const std::string& parent_id) { parent_id_ = parent_id; }
39 void set_type(const std::string& type) { type_ = type; }
40 void set_title(const std::string& title) { title_ = title; }
41 void set_description(const std::string& desc) { description_ = desc; }
42 void set_url(const GURL& url) { url_ = url; }
43 void set_favicon_url(const GURL& url) { favicon_url_ = url; }
45 private:
46 scoped_refptr<content::DevToolsAgentHost> agent_host_;
47 std::string parent_id_;
48 std::string type_;
49 std::string title_;
50 std::string description_;
51 GURL url_;
52 GURL favicon_url_;
53 base::TimeTicks last_activity_time_;
56 } // namespace devtools_discovery
58 #endif // COMPONENTS_DEVTOOLS_DISCOVERY_BASIC_TARGET_DESCRIPTOR_H_