Misc clean up in browser_shutdown.cc.
[chromium-blink-merge.git] / components / open_from_clipboard / fake_clipboard_recent_content.cc
blob9a77fd9b0844b098d50ec204d964dc51ed274137
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_)
14 return false;
16 if (!clipboard_content_.is_valid())
17 return false;
19 *url = clipboard_content_;
20 return true;
23 base::TimeDelta FakeClipboardRecentContent::GetClipboardContentAge() const {
24 return content_age_;
27 void FakeClipboardRecentContent::SuppressClipboardContent() {
28 suppress_content_ = true;
31 void FakeClipboardRecentContent::RecentURLDisplayed() {}
33 void FakeClipboardRecentContent::SetClipboardContent(
34 const GURL& url,
35 base::TimeDelta content_age) {
36 clipboard_content_ = url;
37 content_age_ = content_age;
38 suppress_content_ = false;