Redesign intent picker as part of the omnibox.

The most important change is that the picker is no longer blocking the
navigation, it will instead be shown as a bubble anchored at the onmibox
(next to the bookmark star).

We are reusing most of the previous UI but refactored so it is
compatible with the bubble class used for the location_bar. The strings
presented to the user via the buttons has changed and we also added a
checkbox as a way to remember a preferred app. There is no way the user
will see Chrome listed as an available app, we enforce this in the code
and test it on the new case on the unittest.

We still rely on ArcNavigationThrottle to watch the current navigation,
but we only need to know whether we have ARC apps for the current URL
and/or if we have a recorded preferred app. It's worth noting that the
throttle will never block (DEFER) the navigation.

Bug: 678141
Test: intent_picker_bubble_view_unittest must pass.
Change-Id: I2e53fe96a294676bbd79ce39d9e373593f2c11b4
Reviewed-on: https://chromium-review.googlesource.com/666492
Commit-Queue: David Jacobo <[email protected]>
Reviewed-by: Scott Violet <[email protected]>
Reviewed-by: Yusuke Sato <[email protected]>
Reviewed-by: Evan Stade <[email protected]>
Cr-Commit-Position: refs/heads/master@{#508886}
diff --git a/chrome/browser/ui/browser_commands.h b/chrome/browser/ui/browser_commands.h
index 059ec30..104776e 100644
--- a/chrome/browser/ui/browser_commands.h
+++ b/chrome/browser/ui/browser_commands.h
@@ -6,6 +6,7 @@
 #define CHROME_BROWSER_UI_BROWSER_COMMANDS_H_
 
 #include <string>
+#include <vector>
 
 #include "build/build_config.h"
 #include "chrome/browser/devtools/devtools_toggle_action.h"
@@ -15,6 +16,11 @@
 #include "printing/features/features.h"
 #include "ui/base/window_open_disposition.h"
 
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/arc/intent_helper/arc_navigation_throttle.h"
+#include "chrome/browser/ui/browser_dialogs.h"
+#endif
+
 class Browser;
 class CommandObserver;
 class GURL;
@@ -144,6 +150,13 @@
 void ToggleFullscreenMode(Browser* browser);
 void ClearCache(Browser* browser);
 bool IsDebuggerAttachedToCurrentTab(Browser* browser);
+#if defined(OS_CHROMEOS)
+void QueryAndDisplayArcApps(
+    const Browser* browser,
+    const std::vector<arc::ArcNavigationThrottle::AppInfo>& app_info,
+    IntentPickerResponse callback);
+void SetIntentPickerViewVisibility(Browser* browser, bool visible);
+#endif  // defined(OS_CHROMEOS)
 
 // Opens a view-source tab for a given web contents.
 void ViewSource(Browser* browser, content::WebContents* tab);