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

Side by Side Diff: components/open_from_clipboard/clipboard_recent_content_ios.mm

Issue 2808413003: Omnibox - Reduce Clipboard URL Suggestions to 1 Hour (Closed)
Patch Set: cleanup field trial.h Created 3 years, 8 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
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 #import "components/open_from_clipboard/clipboard_recent_content_ios.h" 5 #import "components/open_from_clipboard/clipboard_recent_content_ios.h"
6 6
7 #import <CommonCrypto/CommonDigest.h> 7 #import <CommonCrypto/CommonDigest.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #import <UIKit/UIKit.h> 10 #import <UIKit/UIKit.h>
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 CC_MD5(c_string, strlen(c_string), hash); 94 CC_MD5(c_string, strlen(c_string), hash);
95 NSData* data = [NSData dataWithBytes:hash length:4]; 95 NSData* data = [NSData dataWithBytes:hash length:4];
96 return data; 96 return data;
97 } 97 }
98 98
99 } // namespace 99 } // namespace
100 100
101 bool ClipboardRecentContentIOS::GetRecentURLFromClipboard(GURL* url) { 101 bool ClipboardRecentContentIOS::GetRecentURLFromClipboard(GURL* url) {
102 DCHECK(url); 102 DCHECK(url);
103 UpdateIfNeeded(); 103 UpdateIfNeeded();
104 if (GetClipboardContentAge() > kMaximumAgeOfClipboard) { 104 if (GetClipboardContentAge() > MaximumAgeOfClipboard()) {
105 return false; 105 return false;
106 } 106 }
107 107
108 GURL url_from_pasteboard = URLFromPasteboard(); 108 GURL url_from_pasteboard = URLFromPasteboard();
109 if (url_from_pasteboard.is_valid()) { 109 if (url_from_pasteboard.is_valid()) {
110 *url = url_from_pasteboard; 110 *url = url_from_pasteboard;
111 return true; 111 return true;
112 } 112 }
113 return false; 113 return false;
114 } 114 }
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 forKey:kPasteboardChangeCountKey]; 226 forKey:kPasteboardChangeCountKey];
227 [shared_user_defaults_ setObject:last_pasteboard_change_date_ 227 [shared_user_defaults_ setObject:last_pasteboard_change_date_
228 forKey:kPasteboardChangeDateKey]; 228 forKey:kPasteboardChangeDateKey];
229 [shared_user_defaults_ setObject:last_pasteboard_entry_md5_ 229 [shared_user_defaults_ setObject:last_pasteboard_entry_md5_
230 forKey:kPasteboardEntryMD5Key]; 230 forKey:kPasteboardEntryMD5Key];
231 } 231 }
232 232
233 base::TimeDelta ClipboardRecentContentIOS::Uptime() const { 233 base::TimeDelta ClipboardRecentContentIOS::Uptime() const {
234 return base::SysInfo::Uptime(); 234 return base::SysInfo::Uptime();
235 } 235 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698