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

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

Issue 2697663002: Clean up naming of paint-related identifiers (Closed)
Patch Set: Rebase Created 3 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
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/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 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 } 1095 }
1096 1096
1097 void LocationBarView::OnFocus() { 1097 void LocationBarView::OnFocus() {
1098 omnibox_view_->SetFocus(); 1098 omnibox_view_->SetFocus();
1099 } 1099 }
1100 1100
1101 void LocationBarView::OnPaint(gfx::Canvas* canvas) { 1101 void LocationBarView::OnPaint(gfx::Canvas* canvas) {
1102 View::OnPaint(canvas); 1102 View::OnPaint(canvas);
1103 1103
1104 if (show_focus_rect_ && omnibox_view_->HasFocus()) { 1104 if (show_focus_rect_ && omnibox_view_->HasFocus()) {
1105 cc::PaintFlags paint; 1105 cc::PaintFlags flags;
1106 paint.setAntiAlias(true); 1106 flags.setAntiAlias(true);
1107 paint.setColor(GetNativeTheme()->GetSystemColor( 1107 flags.setColor(GetNativeTheme()->GetSystemColor(
1108 ui::NativeTheme::NativeTheme::kColorId_FocusedBorderColor)); 1108 ui::NativeTheme::NativeTheme::kColorId_FocusedBorderColor));
1109 paint.setStyle(cc::PaintFlags::kStroke_Style); 1109 flags.setStyle(cc::PaintFlags::kStroke_Style);
1110 paint.setStrokeWidth(1); 1110 flags.setStrokeWidth(1);
1111 gfx::RectF focus_rect(GetLocalBounds()); 1111 gfx::RectF focus_rect(GetLocalBounds());
1112 focus_rect.Inset(gfx::InsetsF(0.5f)); 1112 focus_rect.Inset(gfx::InsetsF(0.5f));
1113 canvas->DrawRoundRect(focus_rect, 1113 canvas->DrawRoundRect(focus_rect,
1114 BackgroundWith1PxBorder::kCornerRadius + 0.5f, paint); 1114 BackgroundWith1PxBorder::kCornerRadius + 0.5f, flags);
1115 } 1115 }
1116 } 1116 }
1117 1117
1118 void LocationBarView::OnPaintBorder(gfx::Canvas* canvas) { 1118 void LocationBarView::OnPaintBorder(gfx::Canvas* canvas) {
1119 if (!is_popup_mode_) 1119 if (!is_popup_mode_)
1120 return; // The border is painted by our Background. 1120 return; // The border is painted by our Background.
1121 1121
1122 gfx::Rect bounds(GetContentsBounds()); 1122 gfx::Rect bounds(GetContentsBounds());
1123 const SkColor border_color = 1123 const SkColor border_color =
1124 GetOpaqueBorderColor(profile()->IsOffTheRecord()); 1124 GetOpaqueBorderColor(profile()->IsOffTheRecord());
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 // LocationBarView, private TemplateURLServiceObserver implementation: 1195 // LocationBarView, private TemplateURLServiceObserver implementation:
1196 1196
1197 void LocationBarView::OnTemplateURLServiceChanged() { 1197 void LocationBarView::OnTemplateURLServiceChanged() {
1198 template_url_service_->RemoveObserver(this); 1198 template_url_service_->RemoveObserver(this);
1199 template_url_service_ = nullptr; 1199 template_url_service_ = nullptr;
1200 // If the browser is no longer active, let's not show the info bubble, as this 1200 // If the browser is no longer active, let's not show the info bubble, as this
1201 // would make the browser the active window again. 1201 // would make the browser the active window again.
1202 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) 1202 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive())
1203 ShowFirstRunBubble(); 1203 ShowFirstRunBubble();
1204 } 1204 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698