Chromium Code Reviews
Help | Chromium Project | Sign in
(21)

Issue 481012: Mac: implement DnD of URLs onto Omnibox. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
5 years, 5 months ago by viettrungluu
Modified:
3 years, 11 months ago
Reviewers:
Scott Hess
CC:
chromium-reviews_googlegroups.com, John Grabowski, pam+watch_chromium.org, ben+cc_chromium.org
Visibility:
Public.

Description

Mac: implement DnD of URLs onto Omnibox. (DnD of text coming in another patch.) BUG=24631 TEST=Select a URL/link/file from somewhere (a link in a browser, a URL in text, a file from the desktop, etc.) and drag it to the Omnibox in a Chromium browser window; the contents of the Omnibox should be selected to indicate that a drop would replace its contents; dropping should navigate to the appropriate location. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=34998

Patch Set 1 #

Total comments: 5

Patch Set 2 : Updated. Will now go make unit tests build (and work). #

Patch Set 3 : Whatdya know? The unit tests already build. I guess we can ship it. #

Total comments: 10

Patch Set 4 : Stuff. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+179 lines, -95 lines) Patch
M chrome/browser/cocoa/autocomplete_text_field.h View 1 2 chunks +6 lines, -2 lines 0 comments Download
M chrome/browser/cocoa/autocomplete_text_field.mm View 1 2 3 3 chunks +36 lines, -0 lines 0 comments Download
M chrome/browser/cocoa/autocomplete_text_field_editor.mm View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/cocoa/browser_window_controller.h View 1 4 chunks +7 lines, -11 lines 0 comments Download
M chrome/browser/cocoa/browser_window_controller.mm View 1 2 3 4 chunks +5 lines, -20 lines 0 comments Download
M chrome/browser/cocoa/tab_strip_controller.h View 1 3 chunks +2 lines, -7 lines 0 comments Download
M chrome/browser/cocoa/tab_strip_controller.mm View 1 8 chunks +25 lines, -19 lines 0 comments Download
M chrome/browser/cocoa/tab_strip_view.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/cocoa/tab_strip_view.mm View 2 chunks +13 lines, -4 lines 0 comments Download
M chrome/browser/cocoa/toolbar_controller.h View 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/cocoa/toolbar_controller.mm View 2 3 2 chunks +35 lines, -0 lines 0 comments Download
M chrome/browser/cocoa/url_drop_target.h View 1 2 chunks +36 lines, -15 lines 0 comments Download
M chrome/browser/cocoa/url_drop_target.mm View 1 4 chunks +6 lines, -14 lines 0 comments Download
Trybot results:
Commit: CQ not working?

Messages

Total messages: 5 (0 generated)
viettrungluu
5 years, 5 months ago (2009-12-10 00:06:25 UTC) #1
Scott Hess
http://codereview.chromium.org/481012/diff/1/4 File chrome/browser/cocoa/autocomplete_text_field_editor.h (right): http://codereview.chromium.org/481012/diff/1/4#newcode7 chrome/browser/cocoa/autocomplete_text_field_editor.h:7: #include "base/scoped_nsobject.h" Suspect this is leftover from earlier prototyping. ...
5 years, 5 months ago (2009-12-10 22:05:21 UTC) #2
viettrungluu
Okay, stuff refactored. Please re-review. My plan is to wear you down till you concede ...
5 years, 5 months ago (2009-12-18 18:40:20 UTC) #3
Scott Hess
LGTM, with the #if 0 code removed. http://codereview.chromium.org/481012/diff/7001/7003 File chrome/browser/cocoa/autocomplete_text_field.mm (right): http://codereview.chromium.org/481012/diff/7001/7003#newcode261 chrome/browser/cocoa/autocomplete_text_field.mm:261: return [windowController ...
5 years, 5 months ago (2009-12-18 21:36:48 UTC) #4
viettrungluu
5 years, 5 months ago (2009-12-18 22:25:02 UTC) #5
Thanks.

http://codereview.chromium.org/481012/diff/7001/7003
File chrome/browser/cocoa/autocomplete_text_field.mm (right):

http://codereview.chromium.org/481012/diff/7001/7003#newcode261
chrome/browser/cocoa/autocomplete_text_field.mm:261: return [windowController
toolbarController];
On 2009/12/18 21:36:48, shess wrote:
> This is just sad.  I don't have a real alternative, though.  At least the
local
> code is making the decision about how to route things, though.

Probably what we need is a |-controller| method of some sort which is always
safe.

http://codereview.chromium.org/481012/diff/7001/7003#newcode268
chrome/browser/cocoa/autocomplete_text_field.mm:268: // TODO(viettrungluu): This
is a hack....
On 2009/12/18 21:36:48, shess wrote:
> Please note that this doesn't restore focus when your drag exits the field.
> 
> Or just go ahead and log the bug now, before someone beats you to it :-).

Done.

http://codereview.chromium.org/481012/diff/7001/7006
File chrome/browser/cocoa/browser_window_controller.mm (right):

http://codereview.chromium.org/481012/diff/7001/7006#newcode1548
chrome/browser/cocoa/browser_window_controller.mm:1548: #if 0
On 2009/12/18 21:36:48, shess wrote:
> Is this meant to be gone-gone now?
> 
> [Presumably along with the autocomplete_text_field.h include?]

Oops. Gone.

http://codereview.chromium.org/481012/diff/7001/7012
File chrome/browser/cocoa/toolbar_controller.mm (right):

http://codereview.chromium.org/481012/diff/7001/7012#newcode688
chrome/browser/cocoa/toolbar_controller.mm:688: DCHECK_EQ(view,
locationBarRetainer_.get());
On 2009/12/18 21:36:48, shess wrote:
> I see these references to locationBarRetainer_, but you never use it in the
> implementation, so they are irrelevant.

Okay. They're gone.

> That said, I'd kind of expect this code to live in the locationBar somehow,
> though I can't for the life of me tell if there is any consistency in the
other
> platforms (some code seems to live in autocomplete/, which is probably not
great
> for this - unless you do convert-to-vector and pass them over there), so I
guess
> I shouldn't flog on that horse.

If I could find a better home for this code, I'd put it there, but the way the
code is divided is kind of awkward....

http://codereview.chromium.org/481012/diff/7001/7013
File chrome/browser/cocoa/url_drop_target.h (right):

http://codereview.chromium.org/481012/diff/7001/7013#newcode22
chrome/browser/cocoa/url_drop_target.h:22: -
(id)initWithView:(NSView<URLDropTarget>*)view;
On 2009/12/18 21:36:48, shess wrote:
> I still don't really understand why you don't just:
> 
> - (id)initWithView:(NSView<URLDropTarget>*)view
> controller:(id<URLDropTargetController>)controller;
> 
> and get rid of -urlDropController.

Probably stubbornness on my part. Or maybe eventually I'll add some sort of
-controller method to everything in sight.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld ec887be