| OLD | NEW |
| 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/location_bar/location_bar_view.h" | 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1088 } | 1088 } |
| 1089 | 1089 |
| 1090 void LocationBarView::OnFocus() { | 1090 void LocationBarView::OnFocus() { |
| 1091 omnibox_view_->SetFocus(); | 1091 omnibox_view_->SetFocus(); |
| 1092 } | 1092 } |
| 1093 | 1093 |
| 1094 void LocationBarView::OnPaint(gfx::Canvas* canvas) { | 1094 void LocationBarView::OnPaint(gfx::Canvas* canvas) { |
| 1095 View::OnPaint(canvas); | 1095 View::OnPaint(canvas); |
| 1096 | 1096 |
| 1097 if (show_focus_rect_ && omnibox_view_->HasFocus()) { | 1097 if (show_focus_rect_ && omnibox_view_->HasFocus()) { |
| 1098 cc::PaintFlags paint; | 1098 cc::PaintFlags flags; |
| 1099 paint.setAntiAlias(true); | 1099 flags.setAntiAlias(true); |
| 1100 paint.setColor(GetNativeTheme()->GetSystemColor( | 1100 flags.setColor(GetNativeTheme()->GetSystemColor( |
| 1101 ui::NativeTheme::NativeTheme::kColorId_FocusedBorderColor)); | 1101 ui::NativeTheme::NativeTheme::kColorId_FocusedBorderColor)); |
| 1102 paint.setStyle(cc::PaintFlags::kStroke_Style); | 1102 flags.setStyle(cc::PaintFlags::kStroke_Style); |
| 1103 paint.setStrokeWidth(1); | 1103 flags.setStrokeWidth(1); |
| 1104 gfx::RectF focus_rect(GetLocalBounds()); | 1104 gfx::RectF focus_rect(GetLocalBounds()); |
| 1105 focus_rect.Inset(gfx::InsetsF(0.5f)); | 1105 focus_rect.Inset(gfx::InsetsF(0.5f)); |
| 1106 canvas->DrawRoundRect(focus_rect, | 1106 canvas->DrawRoundRect(focus_rect, |
| 1107 BackgroundWith1PxBorder::kCornerRadius + 0.5f, paint); | 1107 BackgroundWith1PxBorder::kCornerRadius + 0.5f, flags); |
| 1108 } | 1108 } |
| 1109 } | 1109 } |
| 1110 | 1110 |
| 1111 void LocationBarView::OnPaintBorder(gfx::Canvas* canvas) { | 1111 void LocationBarView::OnPaintBorder(gfx::Canvas* canvas) { |
| 1112 if (!is_popup_mode_) | 1112 if (!is_popup_mode_) |
| 1113 return; // The border is painted by our Background. | 1113 return; // The border is painted by our Background. |
| 1114 | 1114 |
| 1115 gfx::Rect bounds(GetContentsBounds()); | 1115 gfx::Rect bounds(GetContentsBounds()); |
| 1116 const SkColor border_color = | 1116 const SkColor border_color = |
| 1117 GetOpaqueBorderColor(profile()->IsOffTheRecord()); | 1117 GetOpaqueBorderColor(profile()->IsOffTheRecord()); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1188 // LocationBarView, private TemplateURLServiceObserver implementation: | 1188 // LocationBarView, private TemplateURLServiceObserver implementation: |
| 1189 | 1189 |
| 1190 void LocationBarView::OnTemplateURLServiceChanged() { | 1190 void LocationBarView::OnTemplateURLServiceChanged() { |
| 1191 template_url_service_->RemoveObserver(this); | 1191 template_url_service_->RemoveObserver(this); |
| 1192 template_url_service_ = nullptr; | 1192 template_url_service_ = nullptr; |
| 1193 // If the browser is no longer active, let's not show the info bubble, as this | 1193 // If the browser is no longer active, let's not show the info bubble, as this |
| 1194 // would make the browser the active window again. | 1194 // would make the browser the active window again. |
| 1195 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) | 1195 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) |
| 1196 ShowFirstRunBubble(); | 1196 ShowFirstRunBubble(); |
| 1197 } | 1197 } |
| OLD | NEW |