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

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

Issue 1417353003: Move UrlBar background drawing to CC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix yusofo's nit Created 5 years, 1 month 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/tab_layer.h" 5 #include "chrome/browser/android/compositor/layer/tab_layer.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "cc/layers/layer.h" 8 #include "cc/layers/layer.h"
9 #include "cc/layers/layer_lists.h" 9 #include "cc/layers/layer_lists.h"
10 #include "cc/layers/nine_patch_layer.h" 10 #include "cc/layers/nine_patch_layer.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 float brightness, 89 float brightness,
90 float close_btn_width, 90 float close_btn_width,
91 float static_to_view_blend, 91 float static_to_view_blend,
92 float content_width, 92 float content_width,
93 float content_height, 93 float content_height,
94 float view_width, 94 float view_width,
95 float view_height, 95 float view_height,
96 bool show_toolbar, 96 bool show_toolbar,
97 int toolbar_background_color, 97 int toolbar_background_color,
98 bool anonymize_toolbar, 98 bool anonymize_toolbar,
99 int toolbar_textbox_resource_id,
99 int toolbar_textbox_background_color, 100 int toolbar_textbox_background_color,
101 float toolbar_textbox_alpha,
100 float toolbar_alpha, 102 float toolbar_alpha,
101 float toolbar_y_offset, 103 float toolbar_y_offset,
102 float side_border_scale, 104 float side_border_scale,
103 bool attach_content, 105 bool attach_content,
104 bool inset_border) { 106 bool inset_border) {
105 if (alpha <= 0) { 107 if (alpha <= 0) {
106 layer_->SetHideLayerAndSubtree(true); 108 layer_->SetHideLayerAndSubtree(true);
107 return; 109 return;
108 } 110 }
109 111
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 if (toolbar_resource) { 181 if (toolbar_resource) {
180 //-------------------------------------------------------------------------- 182 //--------------------------------------------------------------------------
181 // Update Resource Ids For Layers That Impact Layout 183 // Update Resource Ids For Layers That Impact Layout
182 //-------------------------------------------------------------------------- 184 //--------------------------------------------------------------------------
183 185
184 // TODO(kkimlabs): Tab switcher doesn't show the progress bar. 186 // TODO(kkimlabs): Tab switcher doesn't show the progress bar.
185 toolbar_layer_->PushResource(toolbar_resource, 187 toolbar_layer_->PushResource(toolbar_resource,
186 toolbar_background_color, 188 toolbar_background_color,
187 anonymize_toolbar, 189 anonymize_toolbar,
188 toolbar_textbox_background_color, 190 toolbar_textbox_background_color,
191 toolbar_textbox_resource_id,
192 toolbar_textbox_alpha,
189 false, 193 false,
190 1.f); 194 1.f);
191 toolbar_layer_->UpdateProgressBar(0, 0, 0, 0, 0, 0, 0, 0, 0, 0); 195 toolbar_layer_->UpdateProgressBar(0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
192 196
193 if (show_toolbar && !back_visible) 197 if (show_toolbar && !back_visible)
194 toolbar_impact_height = toolbar_resource->padding.height(); 198 toolbar_impact_height = toolbar_resource->padding.height();
195 } 199 }
196 200
197 //---------------------------------------------------------------------------- 201 //----------------------------------------------------------------------------
198 // Compute Alpha and Visibility 202 // Compute Alpha and Visibility
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 } 540 }
537 541
538 TabLayer::TabLayer(bool incognito, 542 TabLayer::TabLayer(bool incognito,
539 ui::ResourceManager* resource_manager, 543 ui::ResourceManager* resource_manager,
540 LayerTitleCache* layer_title_cache, 544 LayerTitleCache* layer_title_cache,
541 TabContentManager* tab_content_manager) 545 TabContentManager* tab_content_manager)
542 : incognito_(incognito), 546 : incognito_(incognito),
543 resource_manager_(resource_manager), 547 resource_manager_(resource_manager),
544 layer_title_cache_(layer_title_cache), 548 layer_title_cache_(layer_title_cache),
545 layer_(cc::Layer::Create(content::Compositor::LayerSettings())), 549 layer_(cc::Layer::Create(content::Compositor::LayerSettings())),
546 toolbar_layer_(ToolbarLayer::Create()), 550 toolbar_layer_(ToolbarLayer::Create(resource_manager)),
547 title_(cc::Layer::Create(content::Compositor::LayerSettings())), 551 title_(cc::Layer::Create(content::Compositor::LayerSettings())),
548 content_(ContentLayer::Create(tab_content_manager)), 552 content_(ContentLayer::Create(tab_content_manager)),
549 padding_( 553 padding_(
550 cc::SolidColorLayer::Create(content::Compositor::LayerSettings())), 554 cc::SolidColorLayer::Create(content::Compositor::LayerSettings())),
551 close_button_( 555 close_button_(
552 cc::UIResourceLayer::Create(content::Compositor::LayerSettings())), 556 cc::UIResourceLayer::Create(content::Compositor::LayerSettings())),
553 front_border_( 557 front_border_(
554 cc::NinePatchLayer::Create(content::Compositor::LayerSettings())), 558 cc::NinePatchLayer::Create(content::Compositor::LayerSettings())),
555 contour_shadow_( 559 contour_shadow_(
556 cc::NinePatchLayer::Create(content::Compositor::LayerSettings())), 560 cc::NinePatchLayer::Create(content::Compositor::LayerSettings())),
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 title_->AddChild(layer); 595 title_->AddChild(layer);
592 } 596 }
593 } 597 }
594 598
595 if (title) 599 if (title)
596 title->SetUIResourceIds(); 600 title->SetUIResourceIds();
597 } 601 }
598 602
599 } // namespace android 603 } // namespace android
600 } // namespace chrome 604 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698