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

Side by Side Diff: chrome/browser/android/compositor/layer/contextual_search_layer.cc

Issue 2142263002: Remove ContentViewCore dependency from OverlayPanel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: var name Created 4 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/android/compositor/layer/contextual_search_layer.h" 5 #include "chrome/browser/android/compositor/layer/contextual_search_layer.h"
6 6
7 #include "cc/layers/layer.h" 7 #include "cc/layers/layer.h"
8 #include "cc/layers/nine_patch_layer.h" 8 #include "cc/layers/nine_patch_layer.h"
9 #include "cc/layers/solid_color_layer.h" 9 #include "cc/layers/solid_color_layer.h"
10 #include "cc/layers/ui_resource_layer.h" 10 #include "cc/layers/ui_resource_layer.h"
11 #include "cc/resources/scoped_ui_resource.h" 11 #include "cc/resources/scoped_ui_resource.h"
12 #include "chrome/browser/android/compositor/layer/crushed_sprite_layer.h" 12 #include "chrome/browser/android/compositor/layer/crushed_sprite_layer.h"
13 #include "content/public/browser/android/compositor.h" 13 #include "content/public/browser/android/compositor.h"
14 #include "content/public/browser/android/content_view_core.h"
15 #include "third_party/skia/include/core/SkColor.h" 14 #include "third_party/skia/include/core/SkColor.h"
16 #include "ui/android/resources/crushed_sprite_resource.h" 15 #include "ui/android/resources/crushed_sprite_resource.h"
17 #include "ui/android/resources/resource_manager.h" 16 #include "ui/android/resources/resource_manager.h"
18 #include "ui/base/l10n/l10n_util_android.h" 17 #include "ui/base/l10n/l10n_util_android.h"
19 #include "ui/gfx/color_utils.h" 18 #include "ui/gfx/color_utils.h"
20 19
21 namespace { 20 namespace {
22 21
23 const SkColor kSearchBackgroundColor = SkColorSetRGB(0xee, 0xee, 0xee); 22 const SkColor kSearchBackgroundColor = SkColorSetRGB(0xee, 0xee, 0xee);
24 const SkColor kSearchBarBackgroundColor = SkColorSetRGB(0xff, 0xff, 0xff); 23 const SkColor kSearchBarBackgroundColor = SkColorSetRGB(0xff, 0xff, 0xff);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 int panel_icon_resource_id, 69 int panel_icon_resource_id,
71 int search_provider_icon_sprite_metadata_resource_id, 70 int search_provider_icon_sprite_metadata_resource_id,
72 int arrow_up_resource_id, 71 int arrow_up_resource_id,
73 int close_icon_resource_id, 72 int close_icon_resource_id,
74 int progress_bar_background_resource_id, 73 int progress_bar_background_resource_id,
75 int progress_bar_resource_id, 74 int progress_bar_resource_id,
76 int search_promo_resource_id, 75 int search_promo_resource_id,
77 int peek_promo_ripple_resource_id, 76 int peek_promo_ripple_resource_id,
78 int peek_promo_text_resource_id, 77 int peek_promo_text_resource_id,
79 float dp_to_px, 78 float dp_to_px,
80 content::ContentViewCore* content_view_core, 79 const scoped_refptr<cc::Layer>& content_layer,
81 bool search_promo_visible, 80 bool search_promo_visible,
82 float search_promo_height, 81 float search_promo_height,
83 float search_promo_opacity, 82 float search_promo_opacity,
84 bool search_peek_promo_visible, 83 bool search_peek_promo_visible,
85 float search_peek_promo_height, 84 float search_peek_promo_height,
86 float search_peek_promo_padding, 85 float search_peek_promo_padding,
87 float search_peek_promo_ripple_width, 86 float search_peek_promo_ripple_width,
88 float search_peek_promo_ripple_opacity, 87 float search_peek_promo_ripple_opacity,
89 float search_peek_promo_text_opacity, 88 float search_peek_promo_text_opacity,
90 float search_panel_x, 89 float search_panel_x,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 138
140 float content_view_top = search_bar_bottom + search_promo_height; 139 float content_view_top = search_bar_bottom + search_promo_height;
141 float should_render_bar_border = search_bar_border_visible 140 float should_render_bar_border = search_bar_border_visible
142 && !should_render_progress_bar; 141 && !should_render_progress_bar;
143 142
144 // ----------------------------------------------------------------- 143 // -----------------------------------------------------------------
145 // Overlay Panel 144 // Overlay Panel
146 // ----------------------------------------------------------------- 145 // -----------------------------------------------------------------
147 OverlayPanelLayer::SetProperties( 146 OverlayPanelLayer::SetProperties(
148 dp_to_px, 147 dp_to_px,
149 content_view_core, 148 content_layer,
150 content_view_top, 149 content_view_top,
151 search_panel_x, 150 search_panel_x,
152 search_panel_y, 151 search_panel_y,
153 search_panel_width, 152 search_panel_width,
154 search_panel_height, 153 search_panel_height,
155 search_bar_margin_side, 154 search_bar_margin_side,
156 search_bar_height, 155 search_bar_height,
157 search_bar_top, 156 search_bar_top,
158 search_term_opacity, 157 search_term_opacity,
159 should_render_bar_border, 158 should_render_bar_border,
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 // Progress Bar 502 // Progress Bar
504 progress_bar_->SetIsDrawable(true); 503 progress_bar_->SetIsDrawable(true);
505 progress_bar_->SetFillCenter(true); 504 progress_bar_->SetFillCenter(true);
506 } 505 }
507 506
508 ContextualSearchLayer::~ContextualSearchLayer() { 507 ContextualSearchLayer::~ContextualSearchLayer() {
509 } 508 }
510 509
511 } // namespace android 510 } // namespace android
512 } // namespace chrome 511 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698