System Clipboard: Move checks from system_clipboard over to ui/base clipboard

- Validity checks for items being placed onto the clipboard should be made in
a consistent location.
- Most similar checks, depending only on the SkBitmap properties, already occur
in ui/base clipboard.
- Therefore, I propose to move these checks from system clipboard over to
ui/base clipboard. Text checks are generally already consistent with this,
only checking for more high level changes like the type of text, etc in system
clipboard.
- We can remove the check for SkBitmap::isNull(), because
SkBitmap::drawsNothing() { return this->empty() || this->isNull(); }, effectively
meaning the case was already covered
- This does mean we may pass a empty/invalid SkBitmap through mojo, wasting
the overhead of a mojo call whenever we try to
SystemClipboard::WriteImage(empty SkBitmap). However, I think this should be okay,
given that this should be a fairly lightweight and infrequent call. If not,
I'd propose moving these checks up from ui/base to system_clipboard instead.

Bug: 896479
Change-Id: I5129db6606bc85385aec9d56f34cf9eab0fac778
Reviewed-on: https://chromium-review.googlesource.com/c/1413970
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Darwin Huang <huangdarwin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#623892}
3 files changed