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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 incognito), | 169 incognito), |
170 SkColorGetA(kBorderColor)); | 170 SkColorGetA(kBorderColor)); |
171 } | 171 } |
172 | 172 |
173 void LocationBarView::Init() { | 173 void LocationBarView::Init() { |
174 // We need to be in a Widget, otherwise GetNativeTheme() may change and we're | 174 // We need to be in a Widget, otherwise GetNativeTheme() may change and we're |
175 // not prepared for that. | 175 // not prepared for that. |
176 DCHECK(GetWidget()); | 176 DCHECK(GetWidget()); |
177 | 177 |
178 // Make sure children with layers are clipped. See http://crbug.com/589497 | 178 // Make sure children with layers are clipped. See http://crbug.com/589497 |
179 SetPaintToLayer(true); | 179 SetPaintToLayer(); |
180 layer()->SetFillsBoundsOpaquely(false); | 180 layer()->SetFillsBoundsOpaquely(false); |
181 layer()->SetMasksToBounds(true); | 181 layer()->SetMasksToBounds(true); |
182 | 182 |
183 // Determine the main font. | 183 // Determine the main font. |
184 gfx::FontList font_list = ResourceBundle::GetSharedInstance().GetFontList( | 184 gfx::FontList font_list = ResourceBundle::GetSharedInstance().GetFontList( |
185 ResourceBundle::BaseFont); | 185 ResourceBundle::BaseFont); |
186 const int current_font_size = font_list.GetFontSize(); | 186 const int current_font_size = font_list.GetFontSize(); |
187 constexpr int kDesiredFontSize = 14; | 187 constexpr int kDesiredFontSize = 14; |
188 if (current_font_size != kDesiredFontSize) { | 188 if (current_font_size != kDesiredFontSize) { |
189 font_list = | 189 font_list = |
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1230 // LocationBarView, private TemplateURLServiceObserver implementation: | 1230 // LocationBarView, private TemplateURLServiceObserver implementation: |
1231 | 1231 |
1232 void LocationBarView::OnTemplateURLServiceChanged() { | 1232 void LocationBarView::OnTemplateURLServiceChanged() { |
1233 template_url_service_->RemoveObserver(this); | 1233 template_url_service_->RemoveObserver(this); |
1234 template_url_service_ = nullptr; | 1234 template_url_service_ = nullptr; |
1235 // If the browser is no longer active, let's not show the info bubble, as this | 1235 // If the browser is no longer active, let's not show the info bubble, as this |
1236 // would make the browser the active window again. | 1236 // would make the browser the active window again. |
1237 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) | 1237 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) |
1238 ShowFirstRunBubble(); | 1238 ShowFirstRunBubble(); |
1239 } | 1239 } |
OLD | NEW |