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

Issue 2790993003: Add Generic Implementation of ClipboardRecentContent (Closed)

Created:
3 years, 8 months ago by Mark P
Modified:
3 years, 8 months ago
CC:
chromium-reviews, jdonnelly+watch_chromium.org, msramek+watch_chromium.org, ios-reviews_chromium.org, dcheng, mac-reviews_chromium.org, markusheintz_
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add Generic Implementation of ClipboardRecentContent i.e., an implementation that works on all platforms for which ui/base/Clipboard has an implementation. This is all of them except iOS. The only platform for which the implementation is sufficient at this time to provide the necessary functionality is Android. (The other platforms always return clipboard modification times of the start of epoch, meaning any URLs in the clipboard will not be suggested.) I have tested this interactively and it works. TBR=sky (for the modifications to ui/base/test/test_clipboard.{h,cc} and the inclusion of ui/base/test in components/open_from_clipboard/DEPS ) BUG=682446 Review-Url: https://codereview.chromium.org/2790993003 Cr-Commit-Position: refs/heads/master@{#461631} Committed: https://chromium.googlesource.com/chromium/src/+/054a0eadff47f8d158a2314e3858fb050ada6a4f

Patch Set 1 #

Patch Set 2 : slight polish #

Patch Set 3 : cleanup #

Patch Set 4 : blank line #

Total comments: 6

Patch Set 5 : add detailed unit test, minor implementation modifications, pkasting's comments #

Total comments: 12

Patch Set 6 : use ui/base/test/test_clipboard #

Total comments: 4

Patch Set 7 : suppress suggestion regardless of history_service existing #

Total comments: 4

Patch Set 8 : revise BUILD files #

Patch Set 9 : guard deletion call #

Patch Set 10 : revise build file #

Patch Set 11 : exclude generic files on iOS build #

Patch Set 12 : guard generic instantiation on iOS #

Patch Set 13 : constexpr #

Patch Set 14 : make maxage non-static, plus guard recent content for tests #

Total comments: 2

Patch Set 15 : remember to clear the global instance when it's deleted. #

Patch Set 16 : tested interactively; works. removed field trial force-enable code #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+350 lines, -27 lines) Patch
M chrome/browser/android/omnibox/autocomplete_controller_android.cc View 3 chunks +8 lines, -0 lines 0 comments Download
M chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -0 lines 0 comments Download
M components/omnibox/browser/autocomplete_controller.h View 3 chunks +6 lines, -0 lines 0 comments Download
M components/omnibox/browser/autocomplete_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +23 lines, -6 lines 0 comments Download
M components/open_from_clipboard/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 2 chunks +14 lines, -0 lines 0 comments Download
A components/open_from_clipboard/DEPS View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M components/open_from_clipboard/clipboard_recent_content.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +12 lines, -5 lines 0 comments Download
M components/open_from_clipboard/clipboard_recent_content.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +29 lines, -2 lines 2 comments Download
A components/open_from_clipboard/clipboard_recent_content_generic.h View 1 chunk +38 lines, -0 lines 0 comments Download
A components/open_from_clipboard/clipboard_recent_content_generic.cc View 1 2 3 4 1 chunk +72 lines, -0 lines 0 comments Download
A components/open_from_clipboard/clipboard_recent_content_generic_unittest.cc View 1 2 3 4 5 1 chunk +126 lines, -0 lines 0 comments Download
M components/open_from_clipboard/clipboard_recent_content_ios.mm View 3 chunks +2 lines, -14 lines 0 comments Download
M ui/base/test/test_clipboard.h View 1 2 3 4 5 3 chunks +5 lines, -0 lines 0 comments Download
M ui/base/test/test_clipboard.cc View 1 2 3 4 5 2 chunks +8 lines, -0 lines 0 comments Download

Messages

Total messages: 76 (51 generated)
Mark P
jif@, Can you take a look at this first draft of this changelist? It's mostly ...
3 years, 8 months ago (2017-04-01 00:08:32 UTC) #3
Mark P
jif@ is the primary reviewer of this changelist, but I need certain secondary reviewers for ...
3 years, 8 months ago (2017-04-01 05:21:04 UTC) #8
Mark P
Oh, and +dcheng@ for adding ui/base/clipboard to components/open_from_clipboard/DEPS. Please review that. thanks, mark
3 years, 8 months ago (2017-04-01 05:29:57 UTC) #10
Peter Kasting
LGTM https://codereview.chromium.org/2790993003/diff/60001/components/omnibox/browser/autocomplete_controller.cc File components/omnibox/browser/autocomplete_controller.cc (right): https://codereview.chromium.org/2790993003/diff/60001/components/omnibox/browser/autocomplete_controller.cc#newcode240 components/omnibox/browser/autocomplete_controller.cc:240: clipboard_recent_content_.reset(new ClipboardRecentContentGeneric()); Nit: Prefer =MakeUnique to reset(new https://codereview.chromium.org/2790993003/diff/60001/components/omnibox/browser/autocomplete_controller.cc#newcode244 ...
3 years, 8 months ago (2017-04-01 05:54:29 UTC) #11
dcheng
The DEP on //ui/base/clipboard LGTM Had a few random comments though. https://codereview.chromium.org/2790993003/diff/80001/components/omnibox/browser/omnibox_field_trial.cc File components/omnibox/browser/omnibox_field_trial.cc (right): ...
3 years, 8 months ago (2017-04-02 05:04:03 UTC) #13
Mark P
+sky for the modifications to ui/base/test/test_clipboard.{h,cc} and the inclusion of ui/base/test in components/open_from_clipboard/DEPS thanks all, ...
3 years, 8 months ago (2017-04-02 05:33:57 UTC) #15
Peter Kasting
https://codereview.chromium.org/2790993003/diff/80001/components/open_from_clipboard/clipboard_recent_content_generic.cc File components/open_from_clipboard/clipboard_recent_content_generic.cc (right): https://codereview.chromium.org/2790993003/diff/80001/components/open_from_clipboard/clipboard_recent_content_generic.cc#newcode14 components/open_from_clipboard/clipboard_recent_content_generic.cc:14: base::Time last_modified_time = clipboard->GetClipboardLastModifiedTime(); On 2017/04/02 05:33:56, Mark P ...
3 years, 8 months ago (2017-04-03 01:42:13 UTC) #16
Mark P
https://codereview.chromium.org/2790993003/diff/80001/components/open_from_clipboard/clipboard_recent_content_generic.cc File components/open_from_clipboard/clipboard_recent_content_generic.cc (right): https://codereview.chromium.org/2790993003/diff/80001/components/open_from_clipboard/clipboard_recent_content_generic.cc#newcode14 components/open_from_clipboard/clipboard_recent_content_generic.cc:14: base::Time last_modified_time = clipboard->GetClipboardLastModifiedTime(); On 2017/04/03 01:42:13, Peter Kasting ...
3 years, 8 months ago (2017-04-03 03:54:37 UTC) #17
msramek
https://codereview.chromium.org/2790993003/diff/100001/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc File chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc (right): https://codereview.chromium.org/2790993003/diff/100001/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc#newcode426 chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc:426: ClipboardRecentContent::GetInstance()->SuppressClipboardContent(); On 2017/04/02 05:33:56, Mark P wrote: > For ...
3 years, 8 months ago (2017-04-03 12:37:55 UTC) #18
jif
LGTM
3 years, 8 months ago (2017-04-03 16:06:34 UTC) #19
jif
On 2017/04/03 16:06:34, jif wrote: > LGTM I absolutely reviewed the CL :-) For instance ...
3 years, 8 months ago (2017-04-03 16:22:39 UTC) #20
Mark P
Current status of reviewers: * msramek@ review in progress for chrome_browsing_data_remover_delegate.cc * awaiting sky@ for ...
3 years, 8 months ago (2017-04-03 16:29:54 UTC) #21
jif
https://codereview.chromium.org/2790993003/diff/120001/components/omnibox/browser/omnibox_field_trial.cc File components/omnibox/browser/omnibox_field_trial.cc (right): https://codereview.chromium.org/2790993003/diff/120001/components/omnibox/browser/omnibox_field_trial.cc#newcode48 components/omnibox/browser/omnibox_field_trial.cc:48: // #if defined(OS_IOS) Is this here to stay?
3 years, 8 months ago (2017-04-03 16:32:02 UTC) #24
msramek
I have one more question :) https://codereview.chromium.org/2790993003/diff/120001/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc File chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc (right): https://codereview.chromium.org/2790993003/diff/120001/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc#newcode424 chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc:424: ClipboardRecentContent::GetInstance()->SuppressClipboardContent(); Are we ...
3 years, 8 months ago (2017-04-03 17:44:57 UTC) #35
Mark P
https://codereview.chromium.org/2790993003/diff/120001/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc File chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc (right): https://codereview.chromium.org/2790993003/diff/120001/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc#newcode424 chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc:424: ClipboardRecentContent::GetInstance()->SuppressClipboardContent(); On 2017/04/03 17:44:56, msramek wrote: > Are we ...
3 years, 8 months ago (2017-04-03 18:04:45 UTC) #36
Ted C
On 2017/04/03 18:04:45, Mark P wrote: > https://codereview.chromium.org/2790993003/diff/120001/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc > File chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc > (right): > > ...
3 years, 8 months ago (2017-04-03 18:19:14 UTC) #41
msramek
LGTM, thanks!
3 years, 8 months ago (2017-04-03 18:45:58 UTC) #44
Mark P
Just about ready to submit! Thank all you reviewers (5+) for a prompt review! :-) ...
3 years, 8 months ago (2017-04-03 22:33:08 UTC) #60
Peter Kasting
https://codereview.chromium.org/2790993003/diff/260001/components/omnibox/browser/autocomplete_controller.cc File components/omnibox/browser/autocomplete_controller.cc (right): https://codereview.chromium.org/2790993003/diff/260001/components/omnibox/browser/autocomplete_controller.cc#newcode35 components/omnibox/browser/autocomplete_controller.cc:35: #if !defined(OS_IOS) Nit: Put #if'd #includes in a separate ...
3 years, 8 months ago (2017-04-03 23:35:18 UTC) #61
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2790993003/300001
3 years, 8 months ago (2017-04-04 01:21:06 UTC) #67
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2790993003/300001
3 years, 8 months ago (2017-04-04 04:38:14 UTC) #70
commit-bot: I haz the power
Committed patchset #16 (id:300001) as https://chromium.googlesource.com/chromium/src/+/054a0eadff47f8d158a2314e3858fb050ada6a4f
3 years, 8 months ago (2017-04-04 04:44:41 UTC) #73
Mark P
I'm 85% sure that this is safe on Android because of the way the autocomplete ...
3 years, 8 months ago (2017-04-04 04:53:03 UTC) #74
sky
LGTM
3 years, 8 months ago (2017-04-04 16:44:37 UTC) #75
jif
3 years, 8 months ago (2017-04-05 09:08:28 UTC) #76
Message was sent while issue was closed.
still lgtm

Powered by Google App Engine
This is Rietveld 408576698