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

Side by Side Diff: components/open_from_clipboard/clipboard_recent_content.h

Issue 930323003: Upstream iOS' Open from Clipboard component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated actions.xml Created 5 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #ifndef COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_H_
6 #define COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_H_
7
8 #include <string>
9
10 #include "base/macros.h"
11
12 class GURL;
13
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
16 // old.
17 class ClipboardRecentContent {
18 public:
19 // Returns an instance of the ClipboardContent singleton.
20 static ClipboardRecentContent* GetInstance();
21
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;
25
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;
31 }
32
33 protected:
34 ClipboardRecentContent() {}
35 virtual ~ClipboardRecentContent() {}
36 // Contains the URL scheme opening the app. May be empty.
37 std::string application_scheme_;
38
39 private:
40 DISALLOW_COPY_AND_ASSIGN(ClipboardRecentContent);
41 };
42
43 #endif // COMPONENTS_OPEN_FROM_CLIPBOARD_CLIPBOARD_RECENT_CONTENT_H_
OLDNEW
« no previous file with comments | « components/open_from_clipboard/OWNERS ('k') | components/open_from_clipboard/clipboard_recent_content_ios.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698