OLD | NEW |
(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_ |
OLD | NEW |