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

Unified Diff: components/open_from_clipboard/clipboard_recent_content.h

Issue 1274713003: Refactor ClipboardRecentContent singleton creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comment by jif Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/open_from_clipboard.gypi ('k') | components/open_from_clipboard/clipboard_recent_content.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/open_from_clipboard/clipboard_recent_content.h
diff --git a/components/open_from_clipboard/clipboard_recent_content.h b/components/open_from_clipboard/clipboard_recent_content.h
index ca2cf742b115221ddc76c1d7b981ee13afa34956..e5bef752d71915b6817130b8aacea67216f3a66e 100644
--- a/components/open_from_clipboard/clipboard_recent_content.h
+++ b/components/open_from_clipboard/clipboard_recent_content.h
@@ -17,9 +17,17 @@ class GURL;
// old.
class ClipboardRecentContent {
public:
- // Returns an instance of the ClipboardContent singleton.
+ ClipboardRecentContent();
+ virtual ~ClipboardRecentContent();
+
+ // Returns the global instance of the ClipboardRecentContent singleton. This
+ // method does *not* create the singleton, and an instance must have been set
+ // via a call to SetInstance() before.
static ClipboardRecentContent* GetInstance();
+ // Sets the global instance of ClipboardRecentContent singleton.
+ static void SetInstance(ClipboardRecentContent* instance);
+
// Returns true if the clipboard contains a recent URL that has not been
// supressed, and copies it in |url|. Otherwise, returns false. |url| must not
// be null.
@@ -32,19 +40,6 @@ class ClipboardRecentContent {
// clipboard's content changed.
virtual void SuppressClipboardContent() = 0;
- // Sets which URL scheme this app can be opened with. Used by
- // ClipboardRecentContent to determine whether or not the clipboard contains
- // a relevant URL. |application_scheme| may be empty.
- void set_application_scheme(const std::string& application_scheme) {
- application_scheme_ = application_scheme;
- }
-
- protected:
- ClipboardRecentContent() {}
- virtual ~ClipboardRecentContent() {}
- // Contains the URL scheme opening the app. May be empty.
- std::string application_scheme_;
-
private:
DISALLOW_COPY_AND_ASSIGN(ClipboardRecentContent);
};
« no previous file with comments | « components/open_from_clipboard.gypi ('k') | components/open_from_clipboard/clipboard_recent_content.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698