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

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

Issue 8359029: ui/gfx: Convert Canvas::DrawFocusRect() to use gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address Peter's review Created 9 years, 1 month 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/location_bar_view.h" 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
6 6
7 #if defined(TOOLKIT_USES_GTK) 7 #if defined(TOOLKIT_USES_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 canvas->GetSkCanvas()->drawRoundRect(gfx::RectToSkRect(bounds), radius, 748 canvas->GetSkCanvas()->drawRoundRect(gfx::RectToSkRect(bounds), radius,
749 radius, paint); 749 radius, paint);
750 } else { 750 } else {
751 canvas->FillRectInt(color, bounds.x(), bounds.y(), bounds.width(), 751 canvas->FillRectInt(color, bounds.x(), bounds.y(), bounds.width(),
752 bounds.height()); 752 bounds.height());
753 } 753 }
754 754
755 if (show_focus_rect_ && HasFocus()) { 755 if (show_focus_rect_ && HasFocus()) {
756 gfx::Rect r = location_entry_view_->bounds(); 756 gfx::Rect r = location_entry_view_->bounds();
757 #if defined(OS_WIN) 757 #if defined(OS_WIN)
758 canvas->DrawFocusRect(r.x() - 1, r.y() - 1, r.width() + 2, r.height() + 2); 758 r.Inset(-1, -1);
759 #else 759 #else
760 canvas->DrawFocusRect(r.x() - 1, r.y(), r.width() + 2, r.height()); 760 r.Inset(-1, 0);
761 #endif 761 #endif
762 canvas->DrawFocusRect(r);
762 } 763 }
763 } 764 }
764 765
765 void LocationBarView::SetShowFocusRect(bool show) { 766 void LocationBarView::SetShowFocusRect(bool show) {
766 show_focus_rect_ = show; 767 show_focus_rect_ = show;
767 SchedulePaint(); 768 SchedulePaint();
768 } 769 }
769 770
770 void LocationBarView::SelectAll() { 771 void LocationBarView::SelectAll() {
771 location_entry_->SelectAll(true); 772 location_entry_->SelectAll(true);
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 !suggested_text_view_->GetText().empty(); 1273 !suggested_text_view_->GetText().empty();
1273 } 1274 }
1274 1275
1275 #if !defined(USE_AURA) 1276 #if !defined(USE_AURA)
1276 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { 1277 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() {
1277 CHECK(!views::Widget::IsPureViews()); 1278 CHECK(!views::Widget::IsPureViews());
1278 return static_cast<OmniboxViewWin*>(location_entry_.get()); 1279 return static_cast<OmniboxViewWin*>(location_entry_.get());
1279 } 1280 }
1280 #endif 1281 #endif
1281 #endif 1282 #endif
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/download/download_shelf_view.cc ('k') | chrome/browser/ui/views/tabs/dragged_tab_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698