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

Side by Side Diff: components/open_from_clipboard/fake_clipboard_recent_content.cc

Issue 2230983002: Stop using UIPasteboardChangedNotification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unittest. Created 4 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 unified diff | Download patch
« no previous file with comments | « components/open_from_clipboard/fake_clipboard_recent_content.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/open_from_clipboard/fake_clipboard_recent_content.h" 5 #include "components/open_from_clipboard/fake_clipboard_recent_content.h"
6 6
7 FakeClipboardRecentContent::FakeClipboardRecentContent() 7 FakeClipboardRecentContent::FakeClipboardRecentContent()
8 : content_age_(base::TimeDelta::Max()), suppress_content_(false) {} 8 : content_age_(base::TimeDelta::Max()), suppress_content_(false) {}
9 9
10 FakeClipboardRecentContent::~FakeClipboardRecentContent() {} 10 FakeClipboardRecentContent::~FakeClipboardRecentContent() {}
11 11
12 bool FakeClipboardRecentContent::GetRecentURLFromClipboard(GURL* url) const { 12 bool FakeClipboardRecentContent::GetRecentURLFromClipboard(GURL* url) {
13 if (suppress_content_) 13 if (suppress_content_)
14 return false; 14 return false;
15 15
16 if (!clipboard_content_.is_valid()) 16 if (!clipboard_content_.is_valid())
17 return false; 17 return false;
18 18
19 *url = clipboard_content_; 19 *url = clipboard_content_;
20 return true; 20 return true;
21 } 21 }
22 22
23 base::TimeDelta FakeClipboardRecentContent::GetClipboardContentAge() const { 23 base::TimeDelta FakeClipboardRecentContent::GetClipboardContentAge() const {
24 return content_age_; 24 return content_age_;
25 } 25 }
26 26
27 void FakeClipboardRecentContent::SuppressClipboardContent() { 27 void FakeClipboardRecentContent::SuppressClipboardContent() {
28 suppress_content_ = true; 28 suppress_content_ = true;
29 } 29 }
30 30
31 void FakeClipboardRecentContent::RecentURLDisplayed() {}
32
33 void FakeClipboardRecentContent::SetClipboardContent( 31 void FakeClipboardRecentContent::SetClipboardContent(
34 const GURL& url, 32 const GURL& url,
35 base::TimeDelta content_age) { 33 base::TimeDelta content_age) {
36 clipboard_content_ = url; 34 clipboard_content_ = url;
37 content_age_ = content_age; 35 content_age_ = content_age;
38 suppress_content_ = false; 36 suppress_content_ = false;
39 } 37 }
OLDNEW
« no previous file with comments | « components/open_from_clipboard/fake_clipboard_recent_content.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698