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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_H_
6 #define COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_H_
10 #include "base/macros.h"
14 // Helper class returning an URL if the content of the clipboard can be turned
15 // into an URL, and if it estimates that the content of the clipboard is not too
17 class ClipboardRecentContent
{
19 // Returns an instance of the ClipboardContent singleton.
20 static ClipboardRecentContent
* GetInstance();
22 // Returns true if the clipboard contains a recent URL, and copies it in
23 // |url|. Otherwise, returns false. |url| must not be null.
24 virtual bool GetRecentURLFromClipboard(GURL
* url
) const = 0;
26 // Sets which URL scheme this app can be opened with. Used by
27 // ClipboardRecentContent to determine whether or not the clipboard contains
28 // a relevant URL. |application_scheme| may be empty.
29 void set_application_scheme(const std::string
& application_scheme
) {
30 application_scheme_
= application_scheme
;
34 ClipboardRecentContent() {}
35 virtual ~ClipboardRecentContent() {}
36 // Contains the URL scheme opening the app. May be empty.
37 std::string application_scheme_
;
40 DISALLOW_COPY_AND_ASSIGN(ClipboardRecentContent
);
43 #endif // COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_H_