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

Side by Side Diff: chrome/browser/ui/views/location_bar/keyword_hint_view.cc

Issue 6334152: Clean up RTL methods.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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) 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/views/location_bar/keyword_hint_view.h" 5 #include "chrome/browser/ui/views/location_bar/keyword_hint_view.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 void KeywordHintView::Paint(gfx::Canvas* canvas) { 82 void KeywordHintView::Paint(gfx::Canvas* canvas) {
83 int image_x = leading_label_->IsVisible() ? leading_label_->width() : 0; 83 int image_x = leading_label_->IsVisible() ? leading_label_->width() : 0;
84 84
85 // Since we paint the button image directly on the canvas (instead of using a 85 // Since we paint the button image directly on the canvas (instead of using a
86 // child view), we must mirror the button's position manually if the locale 86 // child view), we must mirror the button's position manually if the locale
87 // is right-to-left. 87 // is right-to-left.
88 gfx::Rect tab_button_bounds(image_x, 88 gfx::Rect tab_button_bounds(image_x,
89 kTabImageYOffset, 89 kTabImageYOffset,
90 kTabButtonBitmap->width(), 90 kTabButtonBitmap->width(),
91 kTabButtonBitmap->height()); 91 kTabButtonBitmap->height());
92 tab_button_bounds.set_x(MirroredLeftPointForRect(tab_button_bounds)); 92 tab_button_bounds.set_x(GetMirroredXForRect(tab_button_bounds));
93 canvas->DrawBitmapInt(*kTabButtonBitmap, 93 canvas->DrawBitmapInt(*kTabButtonBitmap,
94 tab_button_bounds.x(), 94 tab_button_bounds.x(),
95 tab_button_bounds.y()); 95 tab_button_bounds.y());
96 } 96 }
97 97
98 gfx::Size KeywordHintView::GetPreferredSize() { 98 gfx::Size KeywordHintView::GetPreferredSize() {
99 // TODO(sky): currently height doesn't matter, once baseline support is 99 // TODO(sky): currently height doesn't matter, once baseline support is
100 // added this should check baselines. 100 // added this should check baselines.
101 gfx::Size prefsize = leading_label_->GetPreferredSize(); 101 gfx::Size prefsize = leading_label_->GetPreferredSize();
102 int width = prefsize.width(); 102 int width = prefsize.width();
(...skipping 20 matching lines...) Expand all
123 123
124 if (show_labels) { 124 if (show_labels) {
125 pref = leading_label_->GetPreferredSize(); 125 pref = leading_label_->GetPreferredSize();
126 leading_label_->SetBounds(x, 0, pref.width(), height()); 126 leading_label_->SetBounds(x, 0, pref.width(), height());
127 127
128 x += pref.width() + kTabButtonBitmap->width(); 128 x += pref.width() + kTabButtonBitmap->width();
129 pref = trailing_label_->GetPreferredSize(); 129 pref = trailing_label_->GetPreferredSize();
130 trailing_label_->SetBounds(x, 0, pref.width(), height()); 130 trailing_label_->SetBounds(x, 0, pref.width(), height());
131 } 131 }
132 } 132 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/opaque_browser_frame_view.cc ('k') | chrome/browser/ui/views/options/advanced_contents_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698