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

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 8 years, 10 months 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 if (!force_background) { 541 if (!force_background) {
542 disposition = 542 disposition =
543 event_utils::WindowOpenDispositionFromNSEvent([NSApp currentEvent]); 543 event_utils::WindowOpenDispositionFromNSEvent([NSApp currentEvent]);
544 } 544 }
545 545
546 // OpenMatch() may close the popup, which will clear the result set 546 // OpenMatch() may close the popup, which will clear the result set
547 // and, by extension, |match| and its contents. So copy the 547 // and, by extension, |match| and its contents. So copy the
548 // relevant match out to make sure it stays alive until the call 548 // relevant match out to make sure it stays alive until the call
549 // completes. 549 // completes.
550 AutocompleteMatch match = model_->result().match_at(row); 550 AutocompleteMatch match = model_->result().match_at(row);
551 string16 keyword;
552 const bool is_keyword_hint = model_->GetKeywordForMatch(match, &keyword);
553 omnibox_view_->OpenMatch(match, disposition, GURL(), row, 551 omnibox_view_->OpenMatch(match, disposition, GURL(), row,
554 is_keyword_hint ? string16() : keyword); 552 match.keyword);
555 } 553 }
556 554
557 void OmniboxPopupViewMac::UserPressedOptIn(bool opt_in) { 555 void OmniboxPopupViewMac::UserPressedOptIn(bool opt_in) {
558 PromoCounter* counter = profile_->GetInstantPromoCounter(); 556 PromoCounter* counter = profile_->GetInstantPromoCounter();
559 DCHECK(counter); 557 DCHECK(counter);
560 counter->Hide(); 558 counter->Hide();
561 if (opt_in) { 559 if (opt_in) {
562 browser::ShowInstantConfirmDialogIfNecessary([field_ window], profile_); 560 browser::ShowInstantConfirmDialogIfNecessary([field_ window], profile_);
563 } 561 }
564 562
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 bottomLeftCornerRadius:kPopupRoundingRadius 823 bottomLeftCornerRadius:kPopupRoundingRadius
826 bottomRightCornerRadius:kPopupRoundingRadius]; 824 bottomRightCornerRadius:kPopupRoundingRadius];
827 825
828 // Draw the matrix clipped to our border. 826 // Draw the matrix clipped to our border.
829 gfx::ScopedNSGraphicsContextSaveGState scopedGState; 827 gfx::ScopedNSGraphicsContextSaveGState scopedGState;
830 [path addClip]; 828 [path addClip];
831 [super drawRect:rect]; 829 [super drawRect:rect];
832 } 830 }
833 831
834 @end 832 @end
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/search_provider.cc ('k') | chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698