| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_handle_layer.h" | 5 #include "chrome/browser/android/compositor/layer/tab_handle_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/solid_color_layer.h" | 9 #include "cc/layers/solid_color_layer.h" |
| 10 #include "chrome/browser/android/compositor/decoration_title.h" | 10 #include "chrome/browser/android/compositor/decoration_title.h" |
| 11 #include "chrome/browser/android/compositor/layer_title_cache.h" | 11 #include "chrome/browser/android/compositor/layer_title_cache.h" |
| 12 #include "content/public/browser/android/compositor.h" |
| 12 #include "ui/android/resources/resource_manager.h" | 13 #include "ui/android/resources/resource_manager.h" |
| 13 #include "ui/android/resources/ui_resource_android.h" | 14 #include "ui/android/resources/ui_resource_android.h" |
| 14 #include "ui/base/l10n/l10n_util_android.h" | 15 #include "ui/base/l10n/l10n_util_android.h" |
| 15 | 16 |
| 16 namespace chrome { | 17 namespace chrome { |
| 17 namespace android { | 18 namespace android { |
| 18 | 19 |
| 19 // static | 20 // static |
| 20 scoped_refptr<TabHandleLayer> TabHandleLayer::Create( | 21 scoped_refptr<TabHandleLayer> TabHandleLayer::Create( |
| 21 LayerTitleCache* layer_title_cache) { | 22 LayerTitleCache* layer_title_cache) { |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 close_button_->SetOpacity(close_button_alpha); | 171 close_button_->SetOpacity(close_button_alpha); |
| 171 } | 172 } |
| 172 } | 173 } |
| 173 | 174 |
| 174 scoped_refptr<cc::Layer> TabHandleLayer::layer() { | 175 scoped_refptr<cc::Layer> TabHandleLayer::layer() { |
| 175 return layer_; | 176 return layer_; |
| 176 } | 177 } |
| 177 | 178 |
| 178 TabHandleLayer::TabHandleLayer(LayerTitleCache* layer_title_cache) | 179 TabHandleLayer::TabHandleLayer(LayerTitleCache* layer_title_cache) |
| 179 : layer_title_cache_(layer_title_cache), | 180 : layer_title_cache_(layer_title_cache), |
| 180 layer_(cc::Layer::Create()), | 181 layer_(cc::Layer::Create(content::Compositor::LayerSettings())), |
| 181 close_button_(cc::UIResourceLayer::Create()), | 182 close_button_( |
| 182 decoration_tab_(cc::NinePatchLayer::Create()), | 183 cc::UIResourceLayer::Create(content::Compositor::LayerSettings())), |
| 183 border_(cc::SolidColorLayer::Create()), | 184 decoration_tab_( |
| 185 cc::NinePatchLayer::Create(content::Compositor::LayerSettings())), |
| 186 border_( |
| 187 cc::SolidColorLayer::Create(content::Compositor::LayerSettings())), |
| 184 brightness_(1.0f), | 188 brightness_(1.0f), |
| 185 foreground_(false) { | 189 foreground_(false) { |
| 186 decoration_tab_->SetIsDrawable(true); | 190 decoration_tab_->SetIsDrawable(true); |
| 187 layer_->AddChild(decoration_tab_); | 191 layer_->AddChild(decoration_tab_); |
| 188 layer_->AddChild(close_button_); | 192 layer_->AddChild(close_button_); |
| 189 } | 193 } |
| 190 | 194 |
| 191 TabHandleLayer::~TabHandleLayer() { | 195 TabHandleLayer::~TabHandleLayer() { |
| 192 } | 196 } |
| 193 | 197 |
| 194 } // namespace android | 198 } // namespace android |
| 195 } // namespace chrome | 199 } // namespace chrome |
| OLD | NEW |