OLD | NEW |
---|---|
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 Loading... | |
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 gfx::Rect rect(r.x() - 1, r.y() - 1, r.width() + 2, r.height() + 2); |
Peter Kasting
2011/10/24 22:15:13
Nit: Simpler:
#if defined(OS_WIN)
r.Inset(-1,
tfarina
2011/10/25 02:04:53
Done.
| |
759 canvas->DrawFocusRect(rect); | |
759 #else | 760 #else |
760 canvas->DrawFocusRect(r.x() - 1, r.y(), r.width() + 2, r.height()); | 761 gfx::Rect rect(r.x() - 1, r.y(), r.width() + 2, r.height()); |
762 canvas->DrawFocusRect(rect); | |
761 #endif | 763 #endif |
762 } | 764 } |
763 } | 765 } |
764 | 766 |
765 void LocationBarView::SetShowFocusRect(bool show) { | 767 void LocationBarView::SetShowFocusRect(bool show) { |
766 show_focus_rect_ = show; | 768 show_focus_rect_ = show; |
767 SchedulePaint(); | 769 SchedulePaint(); |
768 } | 770 } |
769 | 771 |
770 void LocationBarView::SelectAll() { | 772 void LocationBarView::SelectAll() { |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1272 !suggested_text_view_->GetText().empty(); | 1274 !suggested_text_view_->GetText().empty(); |
1273 } | 1275 } |
1274 | 1276 |
1275 #if !defined(USE_AURA) | 1277 #if !defined(USE_AURA) |
1276 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { | 1278 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { |
1277 CHECK(!views::Widget::IsPureViews()); | 1279 CHECK(!views::Widget::IsPureViews()); |
1278 return static_cast<OmniboxViewWin*>(location_entry_.get()); | 1280 return static_cast<OmniboxViewWin*>(location_entry_.get()); |
1279 } | 1281 } |
1280 #endif | 1282 #endif |
1281 #endif | 1283 #endif |
OLD | NEW |