WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 59264
[chromium] Implement EditorClient::canCopyCut and EditorClient::canPaste
https://bugs.webkit.org/show_bug.cgi?id=59264
Summary
[chromium] Implement EditorClient::canCopyCut and EditorClient::canPaste
Daniel Cheng
Reported
2011-04-22 17:55:25 PDT
This allows the browser to decide if copy/cut/paste operations should be allowed on a per-origin basis, e.g. for extensions.
Attachments
Patch
(2.58 KB, patch)
2011-04-22 18:10 PDT
,
Daniel Cheng
no flags
Details
Formatted Diff
Diff
Patch
(2.68 KB, patch)
2011-04-25 16:56 PDT
,
Daniel Cheng
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Daniel Cheng
Comment 1
2011-04-22 18:10:51 PDT
Created
attachment 90822
[details]
Patch
Daniel Cheng
Comment 2
2011-04-22 18:11:05 PDT
For reference, the relevant Chrome patch can be found at
http://codereview.chromium.org/6480106/
Darin Fisher (:fishd, Google)
Comment 3
2011-04-25 16:50:05 PDT
Comment on
attachment 90822
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=90822&action=review
> Source/WebKit/chromium/public/WebViewClient.h:318 > + virtual bool canTriggerClipboardRead(const WebURL& url) { return false; }
nit: webkit style is to drop the parameter name when the name is just a clone of the type name. nit: these functions are listed in the "Zoom" section, but they don't seem to have anything to do with zooming. it looks like registerProtocolHandler was improperly placed here too!
Daniel Cheng
Comment 4
2011-04-25 16:56:40 PDT
Created
attachment 91024
[details]
Patch
Daniel Cheng
Comment 5
2011-04-25 16:57:14 PDT
(In reply to
comment #3
)
> (From update of
attachment 90822
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=90822&action=review
> > > Source/WebKit/chromium/public/WebViewClient.h:318 > > + virtual bool canTriggerClipboardRead(const WebURL& url) { return false; } > > nit: webkit style is to drop the parameter name when the name is just a clone of the type name. >
Done.
> nit: these functions are listed in the "Zoom" section, but they don't seem to have anything > to do with zooming. it looks like registerProtocolHandler was improperly placed here too!
I've picked (what I hope is) a more appropriate location.
Eric Seidel (no email)
Comment 6
2011-04-26 15:19:34 PDT
Comment on
attachment 91024
[details]
Patch Since Darin sounded generally OK with this, this seems OK to me too.
WebKit Commit Bot
Comment 7
2011-04-26 15:59:17 PDT
Comment on
attachment 91024
[details]
Patch Clearing flags on attachment: 91024 Committed
r84967
: <
http://trac.webkit.org/changeset/84967
>
WebKit Commit Bot
Comment 8
2011-04-26 15:59:22 PDT
All reviewed patches have been landed. Closing bug.
WebKit Review Bot
Comment 9
2011-04-26 16:51:39 PDT
http://trac.webkit.org/changeset/84967
might have broken SnowLeopard Intel Release (WebKit2 Tests)
John Abd-El-Malek
Comment 10
2011-04-27 15:44:13 PDT
Darin: the chrome side of this change,
http://codereview.chromium.org/6480106/
, is related to extensions. Since we'll want to have the IPCs be in chrome, not content layer, adding these APIs to WebViewClient means that we'll have to implement these virtual functions on RenderView, only to call out to the embedder using ContentRendererClient, and then implement this for real in ChromeContentRendererClient. For autofill/spellcheck/devtools, we've created specific interfaces that the webkit layer calls, and implement those in the chrome layer directly. Seems we should do the same here to avoid all the indirection. sounds good? if so, what name do you recommend? WebClipboardPermissionClient? (I suck with naming :) ). thanks, and apologies to Daniel for all the run-around.
Darin Fisher (:fishd, Google)
Comment 11
2011-04-27 16:37:25 PDT
(In reply to
comment #10
)
> Darin: the chrome side of this change,
http://codereview.chromium.org/6480106/
, is related to extensions. Since we'll want to have the IPCs be in chrome, not content layer, adding these APIs to WebViewClient means that we'll have to implement these virtual functions on RenderView, only to call out to the embedder using ContentRendererClient, and then implement this for real in ChromeContentRendererClient. > > For autofill/spellcheck/devtools, we've created specific interfaces that the webkit layer calls, and implement those in the chrome layer directly. Seems we should do the same here to avoid all the indirection. sounds good? if so, what name do you recommend? WebClipboardPermissionClient? (I suck with naming :) ). thanks, and apologies to Daniel for all the run-around.
Ah, good point. A separate WebClipboard{Permission,Policy}Client interface SGTM. We could maybe just call it WebClipboardClient. class WebClipboardClient { public: virtual bool canReadFromClipboard(WebFrame*) = 0; virtual bool canWriteToClipboard(WebFrame*) = 0; }; We could just have the methods be named canRead and canWrite, but that wouldn't scale well if we ever had a number of other read/write policy related client interfaces, and someone wanted to implement more than one of them. Note: I think it would be better to pass the WebFrame instead of the URL, so that the caller can have access to more context if needed.
John Abd-El-Malek
Comment 12
2011-04-27 18:05:37 PDT
Darin: it looks like it would be nice to move the following as well out of RenderView. How about a more generic Web{Permission,Policy}Client? If this sounds good, I can take care of doing this, since it would help with some content refactoring I'd like to do in the browser process. virtual bool allowImages(WebKit::WebFrame* frame, bool enabled_per_settings); virtual bool allowPlugins(WebKit::WebFrame* frame, bool enabled_per_settings); virtual bool allowScript(WebKit::WebFrame* frame, bool enabled_per_settings); virtual bool allowDatabase(WebKit::WebFrame* frame, const WebKit::WebString& name, const WebKit::WebString& display_name, unsigned long estimated_size); virtual void didNotAllowScript(WebKit::WebFrame* frame); virtual void didNotAllowPlugins(WebKit::WebFrame* frame); virtual bool allowScriptExtension(WebKit::WebFrame*, const WebKit::WebString& extension_name, int extensionGroup);
John Abd-El-Malek
Comment 13
2011-04-27 22:43:59 PDT
(In reply to
comment #12
)
> Darin: it looks like it would be nice to move the following as well out of RenderView. How about a more generic Web{Permission,Policy}Client? If this sounds good, I can take care of doing this, since it would help with some content refactoring I'd like to do in the browser process.
just to be clear, this isn't just for cleaning up the browser process (although it will). most of the functions above go to ContentRendererClient, so it'd be good to get them to go directly to the class that deals with them. I had added them to ContentRendererClient so that we can get rid of the remaining dependencies and turn on DEPS checking
John Abd-El-Malek
Comment 14
2011-04-28 15:14:01 PDT
for anyone reading, this was committed in
r85241
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug