OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_TASK_MANAGER_PROVIDERS_WEB_CONTENTS_EXTENSION_TASK_H_ | 5 #ifndef CHROME_BROWSER_TASK_MANAGER_PROVIDERS_WEB_CONTENTS_EXTENSION_TASK_H_ |
6 #define CHROME_BROWSER_TASK_MANAGER_PROVIDERS_WEB_CONTENTS_EXTENSION_TASK_H_ | 6 #define CHROME_BROWSER_TASK_MANAGER_PROVIDERS_WEB_CONTENTS_EXTENSION_TASK_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 // Defines a task manager representation for extensions. | 21 // Defines a task manager representation for extensions. |
22 class ExtensionTask | 22 class ExtensionTask |
23 : public RendererTask, | 23 : public RendererTask, |
24 public extensions::IconImage::Observer { | 24 public extensions::IconImage::Observer { |
25 public: | 25 public: |
26 ExtensionTask(content::WebContents* web_contents, | 26 ExtensionTask(content::WebContents* web_contents, |
27 const extensions::Extension* extension, | 27 const extensions::Extension* extension, |
28 extensions::ViewType view_type); | 28 extensions::ViewType view_type); |
29 ~ExtensionTask() override; | 29 ~ExtensionTask() override; |
30 | 30 |
31 // task_manager::RendererTask: | 31 // task_manager::RendererTask |
32 void UpdateTitle() override; | 32 void UpdateTitle() override; |
33 void UpdateFavicon() override; | 33 void UpdateFavicon() override; |
34 void Activate() override; | 34 void Activate() override; |
35 Type GetType() const override; | 35 Type GetType() const override; |
36 | 36 |
| 37 // task_manager::Task |
| 38 int GetKeepaliveCount() const override; |
| 39 |
37 // extensions::IconImage::Observer | 40 // extensions::IconImage::Observer |
38 void OnExtensionIconImageChanged(extensions::IconImage* image) override; | 41 void OnExtensionIconImageChanged(extensions::IconImage* image) override; |
39 | 42 |
40 private: | 43 private: |
41 // If |extension| is nullptr, this method will get the title from | 44 // If |extension| is nullptr, this method will get the title from |
42 // the |web_contents|. | 45 // the |web_contents|. |
43 base::string16 GetExtensionTitle( | 46 base::string16 GetExtensionTitle( |
44 content::WebContents* web_contents, | 47 content::WebContents* web_contents, |
45 const extensions::Extension* extension, | 48 const extensions::Extension* extension, |
46 extensions::ViewType view_type) const; | 49 extensions::ViewType view_type) const; |
47 | 50 |
48 // This is called upon the creation of this task to load the extension icon | 51 // This is called upon the creation of this task to load the extension icon |
49 // for the first time if any. | 52 // for the first time if any. |
50 void LoadExtensionIcon(const extensions::Extension* extension); | 53 void LoadExtensionIcon(const extensions::Extension* extension); |
51 | 54 |
52 // The favicon of the extension represented by this task. | 55 // The favicon of the extension represented by this task. |
53 std::unique_ptr<extensions::IconImage> extension_icon_; | 56 std::unique_ptr<extensions::IconImage> extension_icon_; |
54 | 57 |
| 58 const extensions::ViewType view_type_; |
| 59 |
55 DISALLOW_COPY_AND_ASSIGN(ExtensionTask); | 60 DISALLOW_COPY_AND_ASSIGN(ExtensionTask); |
56 }; | 61 }; |
57 | 62 |
58 } // namespace task_manager | 63 } // namespace task_manager |
59 | 64 |
60 #endif // CHROME_BROWSER_TASK_MANAGER_PROVIDERS_WEB_CONTENTS_EXTENSION_TASK_H_ | 65 #endif // CHROME_BROWSER_TASK_MANAGER_PROVIDERS_WEB_CONTENTS_EXTENSION_TASK_H_ |
OLD | NEW |