open_url_delegate.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright 2018 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.
  4. #ifndef COMPONENTS_ARC_INTENT_HELPER_OPEN_URL_DELEGATE_H_
  5. #define COMPONENTS_ARC_INTENT_HELPER_OPEN_URL_DELEGATE_H_
  6. #include "ash/components/arc/mojom/intent_helper.mojom.h"
  7. class GURL;
  8. namespace arc {
  9. class OpenUrlDelegate {
  10. public:
  11. virtual ~OpenUrlDelegate() = default;
  12. // Opens the given URL in the Chrome browser.
  13. virtual void OpenUrlFromArc(const GURL& url) = 0;
  14. // Opens the given URL as a web app in the Chrome browser, falling back to
  15. // opening as a tab if no installed web app is found.
  16. virtual void OpenWebAppFromArc(const GURL& url) = 0;
  17. // Opens the given URL in a custom tab.
  18. virtual void OpenArcCustomTab(
  19. const GURL& url,
  20. int32_t task_id,
  21. mojom::IntentHelperHost::OnOpenCustomTabCallback callback) = 0;
  22. // Opens the requested |chrome_page|. If |chrome_page| is a settings page,
  23. // this will open the settings window.
  24. virtual void OpenChromePageFromArc(mojom::ChromePage chrome_page) = 0;
  25. // Opens the installed web app for the given |start_url|, delivering the
  26. // |intent| to that app. If no app is installed, falls back to opening the
  27. // |intent->data| as a tab in the browser, unless |intent->data| is not set,
  28. // in which case nothing happens.
  29. virtual void OpenAppWithIntent(const GURL& start_url,
  30. arc::mojom::LaunchIntentPtr intent) = 0;
  31. };
  32. } // namespace arc
  33. #endif // COMPONENTS_ARC_INTENT_HELPER_OPEN_URL_DELEGATE_H_