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

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

Issue 869453002: Define class names for views class in c/b/ui/views (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: inline class name strings Created 5 years, 11 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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 // The focus forwarder view is a hidden view that should cover the area 337 // The focus forwarder view is a hidden view that should cover the area
338 // between the find text box and the find button so that when the user clicks 338 // between the find text box and the find button so that when the user clicks
339 // in that area we focus on the find text box. 339 // in that area we focus on the find text box.
340 const int find_text_edge = find_text_->x() + find_text_->width(); 340 const int find_text_edge = find_text_->x() + find_text_->width();
341 focus_forwarder_view_->SetBounds( 341 focus_forwarder_view_->SetBounds(
342 find_text_edge, find_previous_button_->y(), 342 find_text_edge, find_previous_button_->y(),
343 find_previous_button_->x() - find_text_edge, 343 find_previous_button_->x() - find_text_edge,
344 find_previous_button_->height()); 344 find_previous_button_->height());
345 } 345 }
346 346
347 const char* FindBarView::GetClassName() const {
348 return "FindBarView";
349 }
350
347 gfx::Size FindBarView::GetPreferredSize() const { 351 gfx::Size FindBarView::GetPreferredSize() const {
348 gfx::Size prefsize = find_text_->GetPreferredSize(); 352 gfx::Size prefsize = find_text_->GetPreferredSize();
349 prefsize.set_height(preferred_height_); 353 prefsize.set_height(preferred_height_);
350 354
351 // Add up all the preferred sizes and margins of the rest of the controls. 355 // Add up all the preferred sizes and margins of the rest of the controls.
352 prefsize.Enlarge(kMarginLeftOfCloseButton + kMarginRightOfCloseButton + 356 prefsize.Enlarge(kMarginLeftOfCloseButton + kMarginRightOfCloseButton +
353 kMarginLeftOfFindTextfield - 357 kMarginLeftOfFindTextfield -
354 find_text_->GetInsets().width(), 358 find_text_->GetInsets().width(),
355 0); 359 0);
356 prefsize.Enlarge(find_previous_button_->GetPreferredSize().width(), 0); 360 prefsize.Enlarge(find_previous_button_->GetPreferredSize().width(), 0);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 501
498 void FindBarView::OnThemeChanged() { 502 void FindBarView::OnThemeChanged() {
499 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 503 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
500 if (GetThemeProvider()) { 504 if (GetThemeProvider()) {
501 close_button_->SetBackground( 505 close_button_->SetBackground(
502 GetThemeProvider()->GetColor(ThemeProperties::COLOR_TAB_TEXT), 506 GetThemeProvider()->GetColor(ThemeProperties::COLOR_TAB_TEXT),
503 rb.GetImageSkiaNamed(IDR_CLOSE_1), 507 rb.GetImageSkiaNamed(IDR_CLOSE_1),
504 rb.GetImageSkiaNamed(IDR_CLOSE_1_MASK)); 508 rb.GetImageSkiaNamed(IDR_CLOSE_1_MASK));
505 } 509 }
506 } 510 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698