| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 gfx::Rect shadow_res_padding = panel_shadow_resource->padding; | 99 gfx::Rect shadow_res_padding = panel_shadow_resource->padding; |
| 100 gfx::Size shadow_bounds( | 100 gfx::Size shadow_bounds( |
| 101 search_panel_width + shadow_res_size.width() | 101 search_panel_width + shadow_res_size.width() |
| 102 - shadow_res_padding.size().width(), | 102 - shadow_res_padding.size().width(), |
| 103 search_panel_height + shadow_res_size.height() | 103 search_panel_height + shadow_res_size.height() |
| 104 - shadow_res_padding.size().height()); | 104 - shadow_res_padding.size().height()); |
| 105 panel_shadow_->SetUIResourceId(panel_shadow_resource->ui_resource->id()); | 105 panel_shadow_->SetUIResourceId(panel_shadow_resource->ui_resource->id()); |
| 106 panel_shadow_->SetBorder(panel_shadow_resource->Border(shadow_bounds)); | 106 panel_shadow_->SetBorder(panel_shadow_resource->Border(shadow_bounds)); |
| 107 panel_shadow_->SetAperture(panel_shadow_resource->aperture); | 107 panel_shadow_->SetAperture(panel_shadow_resource->aperture); |
| 108 panel_shadow_->SetBounds(shadow_bounds); | 108 panel_shadow_->SetBounds(shadow_bounds); |
| 109 gfx::Point shadow_position( | 109 gfx::PointF shadow_position(-shadow_res_padding.origin().x(), |
| 110 -shadow_res_padding.origin().x(), | 110 -shadow_res_padding.origin().y()); |
| 111 -shadow_res_padding.origin().y()); | |
| 112 panel_shadow_->SetPosition(shadow_position); | 111 panel_shadow_->SetPosition(shadow_position); |
| 113 | 112 |
| 114 // --------------------------------------------------------------------------- | 113 // --------------------------------------------------------------------------- |
| 115 // Search Bar Background | 114 // Search Bar Background |
| 116 // --------------------------------------------------------------------------- | 115 // --------------------------------------------------------------------------- |
| 117 gfx::Size background_size(search_panel_width, search_bar_height); | 116 gfx::Size background_size(search_panel_width, search_bar_height); |
| 118 search_bar_background_->SetBounds(background_size); | 117 search_bar_background_->SetBounds(background_size); |
| 119 search_bar_background_->SetPosition(gfx::PointF(0.f, 0.f)); | 118 search_bar_background_->SetPosition(gfx::PointF(0.f, 0.f)); |
| 120 | 119 |
| 121 // --------------------------------------------------------------------------- | 120 // --------------------------------------------------------------------------- |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 | 475 |
| 477 ContextualSearchLayer::~ContextualSearchLayer() { | 476 ContextualSearchLayer::~ContextualSearchLayer() { |
| 478 } | 477 } |
| 479 | 478 |
| 480 scoped_refptr<cc::Layer> ContextualSearchLayer::layer() { | 479 scoped_refptr<cc::Layer> ContextualSearchLayer::layer() { |
| 481 return layer_; | 480 return layer_; |
| 482 } | 481 } |
| 483 | 482 |
| 484 } // namespace android | 483 } // namespace android |
| 485 } // namespace chrome | 484 } // namespace chrome |
| OLD | NEW |