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

Unified Diff: chrome/browser/task_management/providers/web_contents/extension_tag.cc

Issue 1254103002: New Task Manager - Phase 1.3.5: Implement Extension Task Providing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Devlin's comments Created 5 years, 4 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: chrome/browser/task_management/providers/web_contents/extension_tag.cc
diff --git a/chrome/browser/task_management/providers/web_contents/extension_tag.cc b/chrome/browser/task_management/providers/web_contents/extension_tag.cc
new file mode 100644
index 0000000000000000000000000000000000000000..cf9879cc61936b6e432fb7c502564415b0c85a6e
--- /dev/null
+++ b/chrome/browser/task_management/providers/web_contents/extension_tag.cc
@@ -0,0 +1,36 @@
+// Copyright 2015 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.
+
+#include "chrome/browser/task_management/providers/web_contents/extension_tag.h"
+
+#include "content/public/browser/web_contents.h"
+
+#if defined(ENABLE_EXTENSIONS)
+#include "extensions/browser/process_manager.h"
+#endif
+
+namespace task_management {
+
+ExtensionTask* ExtensionTag::CreateTask() const {
+ // Upon being asked to create a task, it means that the site instance is ready
+ // and connected, and the render frames have been initialized.
+ // It's OK if the following returns nullptr, ExtensionTask will then get the
+ // title from the WebContents.
+ const extensions::Extension* extension =
+ extensions::ProcessManager::Get(web_contents()->GetBrowserContext())->
+ GetExtensionForWebContents(web_contents());
+
+ return new ExtensionTask(web_contents(), extension, view_type_);
+}
+
+ExtensionTag::ExtensionTag(content::WebContents* web_contents,
+ const extensions::ViewType view_type)
+ : WebContentsTag(web_contents),
+ view_type_(view_type) {
+}
+
+ExtensionTag::~ExtensionTag() {
+}
+
+} // namespace task_management

Powered by Google App Engine
This is Rietveld 408576698