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

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

Issue 14295003: Re-enable a few find in page tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Leave last test disabled Created 7 years, 8 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/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/string_util.h" 9 #include "base/string_util.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 185
186 void FindBarView::UpdateForResult(const FindNotificationDetails& result, 186 void FindBarView::UpdateForResult(const FindNotificationDetails& result,
187 const string16& find_text) { 187 const string16& find_text) {
188 bool have_valid_range = 188 bool have_valid_range =
189 result.number_of_matches() != -1 && result.active_match_ordinal() != -1; 189 result.number_of_matches() != -1 && result.active_match_ordinal() != -1;
190 190
191 // http://crbug.com/34970: some IMEs get confused if we change the text 191 // http://crbug.com/34970: some IMEs get confused if we change the text
192 // composed by them. To avoid this problem, we should check the IME status and 192 // composed by them. To avoid this problem, we should check the IME status and
193 // update the text only when the IME is not composing text. 193 // update the text only when the IME is not composing text.
194 if (find_text_->text() != find_text && !find_text_->IsIMEComposing()) { 194 if (find_text_->text() != find_text && !find_text_->IsIMEComposing()) {
195 find_text_->SetText(find_text); 195 SetFindText(find_text);
Finnur 2013/04/18 14:49:11 This is really just so that we have a single choke
196 find_text_->SelectAll(true); 196 find_text_->SelectAll(true);
197 } 197 }
198 198
199 if (find_text.empty() || !have_valid_range) { 199 if (find_text.empty() || !have_valid_range) {
200 // If there was no text entered, we don't show anything in the result count 200 // If there was no text entered, we don't show anything in the result count
201 // area. 201 // area.
202 ClearMatchCount(); 202 ClearMatchCount();
203 return; 203 return;
204 } 204 }
205 205
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 515
516 void FindBarView::OnThemeChanged() { 516 void FindBarView::OnThemeChanged() {
517 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 517 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
518 if (GetThemeProvider()) { 518 if (GetThemeProvider()) {
519 close_button_->SetBackground( 519 close_button_->SetBackground(
520 GetThemeProvider()->GetColor(ThemeProperties::COLOR_TAB_TEXT), 520 GetThemeProvider()->GetColor(ThemeProperties::COLOR_TAB_TEXT),
521 rb.GetImageSkiaNamed(IDR_CLOSE_1), 521 rb.GetImageSkiaNamed(IDR_CLOSE_1),
522 rb.GetImageSkiaNamed(IDR_CLOSE_1_MASK)); 522 rb.GetImageSkiaNamed(IDR_CLOSE_1_MASK));
523 } 523 }
524 } 524 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698