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

Side by Side Diff: chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm

Issue 6731036: Enabled pressing TAB to cycle through the Omnibox results. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.h" 5 #include "chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/sys_string_conversions.h" 10 #include "base/sys_string_conversions.h"
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 if (!force_background) { 540 if (!force_background) {
541 disposition = 541 disposition =
542 event_utils::WindowOpenDispositionFromNSEvent([NSApp currentEvent]); 542 event_utils::WindowOpenDispositionFromNSEvent([NSApp currentEvent]);
543 } 543 }
544 544
545 // OpenMatch() may close the popup, which will clear the result set 545 // OpenMatch() may close the popup, which will clear the result set
546 // and, by extension, |match| and its contents. So copy the 546 // and, by extension, |match| and its contents. So copy the
547 // relevant match out to make sure it stays alive until the call 547 // relevant match out to make sure it stays alive until the call
548 // completes. 548 // completes.
549 AutocompleteMatch match = model_->result().match_at(row); 549 AutocompleteMatch match = model_->result().match_at(row);
550 string16 keyword;
551 const bool is_keyword_hint = model_->GetKeywordForMatch(match, &keyword);
552 omnibox_view_->OpenMatch(match, disposition, GURL(), row, 550 omnibox_view_->OpenMatch(match, disposition, GURL(), row,
553 is_keyword_hint ? string16() : keyword); 551 match.keyword);
554 } 552 }
555 553
556 void OmniboxPopupViewMac::UserPressedOptIn(bool opt_in) { 554 void OmniboxPopupViewMac::UserPressedOptIn(bool opt_in) {
557 PromoCounter* counter = profile_->GetInstantPromoCounter(); 555 PromoCounter* counter = profile_->GetInstantPromoCounter();
558 DCHECK(counter); 556 DCHECK(counter);
559 counter->Hide(); 557 counter->Hide();
560 if (opt_in) { 558 if (opt_in) {
561 browser::ShowInstantConfirmDialogIfNecessary([field_ window], profile_); 559 browser::ShowInstantConfirmDialogIfNecessary([field_ window], profile_);
562 } 560 }
563 561
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 bottomLeftCornerRadius:kPopupRoundingRadius 822 bottomLeftCornerRadius:kPopupRoundingRadius
825 bottomRightCornerRadius:kPopupRoundingRadius]; 823 bottomRightCornerRadius:kPopupRoundingRadius];
826 824
827 // Draw the matrix clipped to our border. 825 // Draw the matrix clipped to our border.
828 gfx::ScopedNSGraphicsContextSaveGState scopedGState; 826 gfx::ScopedNSGraphicsContextSaveGState scopedGState;
829 [path addClip]; 827 [path addClip];
830 [super drawRect:rect]; 828 [super drawRect:rect];
831 } 829 }
832 830
833 @end 831 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698