OLD | NEW |
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" |
(...skipping 28 matching lines...) Expand all Loading... |
39 int search_icon_resource_id, | 39 int search_icon_resource_id, |
40 int arrow_up_resource_id, | 40 int arrow_up_resource_id, |
41 int close_icon_resource_id, | 41 int close_icon_resource_id, |
42 int progress_bar_background_resource_id, | 42 int progress_bar_background_resource_id, |
43 int progress_bar_resource_id, | 43 int progress_bar_resource_id, |
44 int search_promo_resource_id, | 44 int search_promo_resource_id, |
45 content::ContentViewCore* content_view_core, | 45 content::ContentViewCore* content_view_core, |
46 bool search_promo_visible, | 46 bool search_promo_visible, |
47 float search_promo_height, | 47 float search_promo_height, |
48 float search_promo_opacity, | 48 float search_promo_opacity, |
| 49 float search_panel_x, |
49 float search_panel_y, | 50 float search_panel_y, |
50 float search_panel_width, | 51 float search_panel_width, |
| 52 float search_panel_height, |
51 float search_bar_margin_top, | 53 float search_bar_margin_top, |
52 float search_bar_margin_side, | 54 float search_bar_margin_side, |
53 float search_bar_height, | 55 float search_bar_height, |
54 float search_bar_text_opacity, | 56 float search_bar_text_opacity, |
55 bool search_bar_border_visible, | 57 bool search_bar_border_visible, |
56 float search_bar_border_y, | 58 float search_bar_border_y, |
57 float search_bar_border_height, | 59 float search_bar_border_height, |
58 bool search_bar_shadow_visible, | 60 bool search_bar_shadow_visible, |
59 float search_bar_shadow_opacity, | 61 float search_bar_shadow_opacity, |
60 bool side_search_provider_icon_visible, | 62 bool side_search_provider_icon_visible, |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 search_bar_shadow_->SetOpacity(search_bar_shadow_opacity); | 347 search_bar_shadow_->SetOpacity(search_bar_shadow_opacity); |
346 } | 348 } |
347 } else { | 349 } else { |
348 if (search_bar_shadow_.get() && search_bar_shadow_->parent()) | 350 if (search_bar_shadow_.get() && search_bar_shadow_->parent()) |
349 search_bar_shadow_->RemoveFromParent(); | 351 search_bar_shadow_->RemoveFromParent(); |
350 } | 352 } |
351 | 353 |
352 // --------------------------------------------------------------------------- | 354 // --------------------------------------------------------------------------- |
353 // Search Panel. | 355 // Search Panel. |
354 // --------------------------------------------------------------------------- | 356 // --------------------------------------------------------------------------- |
355 layer_->SetPosition(gfx::PointF(0.f, search_panel_y)); | 357 layer_->SetPosition(gfx::PointF(search_panel_x, search_panel_y)); |
356 | 358 |
357 // --------------------------------------------------------------------------- | 359 // --------------------------------------------------------------------------- |
358 // Progress Bar | 360 // Progress Bar |
359 // --------------------------------------------------------------------------- | 361 // --------------------------------------------------------------------------- |
360 bool should_render_progress_bar = | 362 bool should_render_progress_bar = |
361 progress_bar_visible && progress_bar_opacity > 0.f; | 363 progress_bar_visible && progress_bar_opacity > 0.f; |
362 if (should_render_progress_bar) { | 364 if (should_render_progress_bar) { |
363 // Grabs Progress Bar resources. | 365 // Grabs Progress Bar resources. |
364 ui::ResourceManager::Resource* progress_bar_background_resource = | 366 ui::ResourceManager::Resource* progress_bar_background_resource = |
365 resource_manager_->GetResource(ui::ANDROID_RESOURCE_TYPE_STATIC, | 367 resource_manager_->GetResource(ui::ANDROID_RESOURCE_TYPE_STATIC, |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 | 506 |
505 ContextualSearchLayer::~ContextualSearchLayer() { | 507 ContextualSearchLayer::~ContextualSearchLayer() { |
506 } | 508 } |
507 | 509 |
508 scoped_refptr<cc::Layer> ContextualSearchLayer::layer() { | 510 scoped_refptr<cc::Layer> ContextualSearchLayer::layer() { |
509 return layer_; | 511 return layer_; |
510 } | 512 } |
511 | 513 |
512 } // namespace android | 514 } // namespace android |
513 } // namespace chrome | 515 } // namespace chrome |
OLD | NEW |