On Mon, Mar 9, 2009 at 9:53 AM, Avi Drissman <[email protected]> wrote:
> Working through crbug.com/8384 (copy/paste), I've had a chance to look at
> Chromium's current copy/paste system.
>
> For those unfamiliar, the copy/paste menu items are always enabled, and send
> a message to TabContents. WebContents implements those methods by forwarding
> them to RenderViewHost, which forwards them over IPC to the RenderView,
> which sends them to the focused WebFrame. He sends it to his Editor (finally
> in WebCore).

There's another bug in this space: webkit actually beeps if you send
it the "copy" message when you shouldn't have.  (I tracked this down
when I was looking into why it has a cross-platform portability layer
for beeping.  We didn't implement on Linux because beeping is NEVER
OK, and also disallowed by the sandbox.)  At least on Windows, no
other app beeps when there is no selection -- I think nobody noticed
this because the first thing you always do when setting up a new
Windows box is turn off the beeping.  :)

http://code.google.com/p/chromium/issues/detail?id=3508

(However, that bug could also perhaps be fixed by a smaller change
than what you propose.)

> Having menu items always selected is workable but rather gauche. And in
> fact, Editor has canCopy(), canPaste(), and a million other can* methods.
> And reverse-piping it through WebFrame is easy, but it starts getting sticky
> once you hit IPC.
>
> The problem is that we need to update the menu items when asked, which will
> be when the user pulls down the menu. Issue #1 is latency, just all those
> round trips over IPC. We could always do a state getting message, where the
> results of can* are all coalesced. But the bigger issue #2 is blocking, and
> locking up the UI if the renderer isn't responding/fast.

Yes, we don't want the UI to wait for the renderer ever.

Maybe a better option is to have the renderer send "FYI,
cut/copy/paste state is now x/y/z" messages up to the UI whenever it
changes?  (I guess paste is out of webkit's hands, but I can imagine
other booleans like whether "select all" should be enabled.)

--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: [email protected] 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to