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 #include "components/open_from_clipboard/fake_clipboard_recent_content.h"
7 FakeClipboardRecentContent::FakeClipboardRecentContent()
8 : content_age_(base::TimeDelta::Max()), suppress_content_(false) {}
10 FakeClipboardRecentContent::~FakeClipboardRecentContent() {}
12 bool FakeClipboardRecentContent::GetRecentURLFromClipboard(GURL
* url
) const {
13 if (suppress_content_
)
16 if (!clipboard_content_
.is_valid())
19 *url
= clipboard_content_
;
23 base::TimeDelta
FakeClipboardRecentContent::GetClipboardContentAge() const {
27 void FakeClipboardRecentContent::SuppressClipboardContent() {
28 suppress_content_
= true;
31 void FakeClipboardRecentContent::RecentURLDisplayed() {}
33 void FakeClipboardRecentContent::SetClipboardContent(
35 base::TimeDelta content_age
) {
36 clipboard_content_
= url
;
37 content_age_
= content_age
;
38 suppress_content_
= false;