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

Side by Side Diff: chrome/browser/ui/views/find_bar_view.cc

Issue 1305153004: Focus comes on the 'close button' in find bar when selecting 'Enter' key. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes as per review comments. Created 5 years, 3 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
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/views/find_bar_view.h" 5 #include "chrome/browser/ui/views/find_bar_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 switch (sender->tag()) { 399 switch (sender->tag()) {
400 case FIND_PREVIOUS_TAG: 400 case FIND_PREVIOUS_TAG:
401 case FIND_NEXT_TAG: 401 case FIND_NEXT_TAG:
402 if (!find_text_->text().empty()) { 402 if (!find_text_->text().empty()) {
403 FindTabHelper* find_tab_helper = FindTabHelper::FromWebContents( 403 FindTabHelper* find_tab_helper = FindTabHelper::FromWebContents(
404 find_bar_host()->GetFindBarController()->web_contents()); 404 find_bar_host()->GetFindBarController()->web_contents());
405 find_tab_helper->StartFinding(find_text_->text(), 405 find_tab_helper->StartFinding(find_text_->text(),
406 sender->tag() == FIND_NEXT_TAG, 406 sender->tag() == FIND_NEXT_TAG,
407 false); // Not case sensitive. 407 false); // Not case sensitive.
408 } 408 }
409 if (event.IsMouseEvent()) { 409 // NotifyClick() now takes ui::Event so event can be mouse event or the
msw 2015/08/27 18:09:02 nit: There is no function named "NotifyClick". Con
Deepak 2015/08/28 04:20:20 Done.
410 // If mouse event, we move the focus back to the text-field, so that the 410 // key event. Moving focus to find text field.
411 // user doesn't have to click on the text field to change the search. We 411 find_text_->RequestFocus();
412 // don't want to do this for keyboard clicks on the button, since the
413 // user is more likely to press FindNext again than change the search
414 // query.
415 find_text_->RequestFocus();
416 }
417 break; 412 break;
418 case CLOSE_TAG: 413 case CLOSE_TAG:
419 find_bar_host()->GetFindBarController()->EndFindSession( 414 find_bar_host()->GetFindBarController()->EndFindSession(
420 FindBarController::kKeepSelectionOnPage, 415 FindBarController::kKeepSelectionOnPage,
421 FindBarController::kKeepResultsInFindBox); 416 FindBarController::kKeepResultsInFindBox);
422 break; 417 break;
423 default: 418 default:
424 NOTREACHED() << L"Unknown button"; 419 NOTREACHED() << L"Unknown button";
425 break; 420 break;
426 } 421 }
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 void FindBarView::OnNativeThemeChanged(const ui::NativeTheme* theme) { 656 void FindBarView::OnNativeThemeChanged(const ui::NativeTheme* theme) {
662 if (!ui::MaterialDesignController::IsModeMaterial()) 657 if (!ui::MaterialDesignController::IsModeMaterial())
663 return; 658 return;
664 659
665 SkColor color = 660 SkColor color =
666 theme->GetSystemColor(ui::NativeTheme::kColorId_DialogBackground); 661 theme->GetSystemColor(ui::NativeTheme::kColorId_DialogBackground);
667 set_background(views::Background::CreateSolidBackground(color)); 662 set_background(views::Background::CreateSolidBackground(color));
668 match_count_text_->SetBackgroundColor(color); 663 match_count_text_->SetBackgroundColor(color);
669 match_count_text_->SetEnabledColor(kMatchTextColorMD); 664 match_count_text_->SetEnabledColor(kMatchTextColorMD);
670 } 665 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698