Sort extensions in menu on page interaction status

This groups extensions into three buckets:

* Extensions that are accessing (can access) the page's data
* Extensions that want to access the page's data
* Extensions that can't access the page's data

Labels are used as headings for each of these three buckets. No label is
added for groups that don't have a corresponding extension.

Bug: chromium:943702
Change-Id: I055f5f8824b65f2833f9d78b1f4289e28aad630e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1577590
Commit-Queue: Peter Boström <[email protected]>
Reviewed-by: Devlin <[email protected]>
Cr-Commit-Position: refs/heads/master@{#654128}
diff --git a/chrome/browser/ui/extensions/extension_action_view_controller.h b/chrome/browser/ui/extensions/extension_action_view_controller.h
index fe3fe031f..362f185 100644
--- a/chrome/browser/ui/extensions/extension_action_view_controller.h
+++ b/chrome/browser/ui/extensions/extension_action_view_controller.h
@@ -58,6 +58,8 @@
   base::string16 GetAccessibleName(content::WebContents* web_contents) const
       override;
   base::string16 GetTooltip(content::WebContents* web_contents) const override;
+  PageInteractionStatus GetPageInteractionStatus(
+      content::WebContents* web_contents) const override;
   bool IsEnabled(content::WebContents* web_contents) const override;
   bool WantsToRun(content::WebContents* web_contents) const override;
   bool HasPopup(content::WebContents* web_contents) const override;
@@ -95,21 +97,6 @@
   // ExtensionHostObserver:
   void OnExtensionHostDestroyed(const extensions::ExtensionHost* host) override;
 
-  // The status of the extension's interaction for the page. This is independent
-  // of the action's clickability.
-  enum class PageInteractionStatus {
-    // The extension cannot run on the page.
-    kNone,
-    // The extension tried to access the page, but is pending user approval.
-    kPending,
-    // The extension has permission to run on the page.
-    kActive,
-  };
-
-  // Returns the PageInteractionStatus for the current page.
-  PageInteractionStatus GetPageInteractionStatus(
-      content::WebContents* web_contents) const;
-
   // Checks if the associated |extension| is still valid by checking its
   // status in the registry. Since the OnExtensionUnloaded() notifications are
   // not in a deterministic order, it's possible that the view tries to refresh