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

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

Issue 2639203007: Update SetPaintToLayer to accept LayerType (Closed)
Patch Set: Refactor Created 3 years, 11 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 #include "content/public/browser/render_widget_host_view.h" 70 #include "content/public/browser/render_widget_host_view.h"
71 #include "content/public/browser/web_contents.h" 71 #include "content/public/browser/web_contents.h"
72 #include "content/public/common/url_constants.h" 72 #include "content/public/common/url_constants.h"
73 #include "extensions/browser/extension_registry.h" 73 #include "extensions/browser/extension_registry.h"
74 #include "extensions/common/feature_switch.h" 74 #include "extensions/common/feature_switch.h"
75 #include "ui/accessibility/ax_node_data.h" 75 #include "ui/accessibility/ax_node_data.h"
76 #include "ui/base/dragdrop/drag_drop_types.h" 76 #include "ui/base/dragdrop/drag_drop_types.h"
77 #include "ui/base/l10n/l10n_util.h" 77 #include "ui/base/l10n/l10n_util.h"
78 #include "ui/base/resource/resource_bundle.h" 78 #include "ui/base/resource/resource_bundle.h"
79 #include "ui/base/theme_provider.h" 79 #include "ui/base/theme_provider.h"
80 #include "ui/compositor/layer_type.h"
80 #include "ui/compositor/paint_recorder.h" 81 #include "ui/compositor/paint_recorder.h"
81 #include "ui/events/event.h" 82 #include "ui/events/event.h"
82 #include "ui/gfx/animation/slide_animation.h" 83 #include "ui/gfx/animation/slide_animation.h"
83 #include "ui/gfx/canvas.h" 84 #include "ui/gfx/canvas.h"
84 #include "ui/gfx/color_palette.h" 85 #include "ui/gfx/color_palette.h"
85 #include "ui/gfx/color_utils.h" 86 #include "ui/gfx/color_utils.h"
86 #include "ui/gfx/image/image.h" 87 #include "ui/gfx/image/image.h"
87 #include "ui/gfx/image/image_skia_operations.h" 88 #include "ui/gfx/image/image_skia_operations.h"
88 #include "ui/gfx/paint_vector_icon.h" 89 #include "ui/gfx/paint_vector_icon.h"
89 #include "ui/gfx/scoped_canvas.h" 90 #include "ui/gfx/scoped_canvas.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 incognito), 170 incognito),
170 SkColorGetA(kBorderColor)); 171 SkColorGetA(kBorderColor));
171 } 172 }
172 173
173 void LocationBarView::Init() { 174 void LocationBarView::Init() {
174 // We need to be in a Widget, otherwise GetNativeTheme() may change and we're 175 // We need to be in a Widget, otherwise GetNativeTheme() may change and we're
175 // not prepared for that. 176 // not prepared for that.
176 DCHECK(GetWidget()); 177 DCHECK(GetWidget());
177 178
178 // Make sure children with layers are clipped. See http://crbug.com/589497 179 // Make sure children with layers are clipped. See http://crbug.com/589497
179 SetPaintToLayer(true); 180 SetPaintToLayer(ui::LAYER_TEXTURED);
180 layer()->SetFillsBoundsOpaquely(false); 181 layer()->SetFillsBoundsOpaquely(false);
181 layer()->SetMasksToBounds(true); 182 layer()->SetMasksToBounds(true);
182 183
183 // Determine the main font. 184 // Determine the main font.
184 gfx::FontList font_list = ResourceBundle::GetSharedInstance().GetFontList( 185 gfx::FontList font_list = ResourceBundle::GetSharedInstance().GetFontList(
185 ResourceBundle::BaseFont); 186 ResourceBundle::BaseFont);
186 const int current_font_size = font_list.GetFontSize(); 187 const int current_font_size = font_list.GetFontSize();
187 constexpr int kDesiredFontSize = 14; 188 constexpr int kDesiredFontSize = 14;
188 if (current_font_size != kDesiredFontSize) { 189 if (current_font_size != kDesiredFontSize) {
189 font_list = 190 font_list =
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 // LocationBarView, private TemplateURLServiceObserver implementation: 1231 // LocationBarView, private TemplateURLServiceObserver implementation:
1231 1232
1232 void LocationBarView::OnTemplateURLServiceChanged() { 1233 void LocationBarView::OnTemplateURLServiceChanged() {
1233 template_url_service_->RemoveObserver(this); 1234 template_url_service_->RemoveObserver(this);
1234 template_url_service_ = nullptr; 1235 template_url_service_ = nullptr;
1235 // If the browser is no longer active, let's not show the info bubble, as this 1236 // 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. 1237 // would make the browser the active window again.
1237 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) 1238 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive())
1238 ShowFirstRunBubble(); 1239 ShowFirstRunBubble();
1239 } 1240 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698