| 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/layer_settings.h" |
| 8 #include "cc/layers/nine_patch_layer.h" | 9 #include "cc/layers/nine_patch_layer.h" |
| 9 #include "cc/layers/solid_color_layer.h" | 10 #include "cc/layers/solid_color_layer.h" |
| 10 #include "cc/layers/ui_resource_layer.h" | 11 #include "cc/layers/ui_resource_layer.h" |
| 11 #include "cc/resources/scoped_ui_resource.h" | 12 #include "cc/resources/scoped_ui_resource.h" |
| 12 #include "chrome/browser/android/compositor/layer/crushed_sprite_layer.h" | 13 #include "chrome/browser/android/compositor/layer/crushed_sprite_layer.h" |
| 13 #include "content/public/browser/android/compositor.h" | 14 #include "content/public/browser/android/compositor.h" |
| 14 #include "content/public/browser/android/content_view_core.h" | 15 #include "content/public/browser/android/content_view_core.h" |
| 15 #include "third_party/skia/include/core/SkColor.h" | 16 #include "third_party/skia/include/core/SkColor.h" |
| 16 #include "ui/android/resources/crushed_sprite_resource.h" | 17 #include "ui/android/resources/crushed_sprite_resource.h" |
| 17 #include "ui/android/resources/resource_manager.h" | 18 #include "ui/android/resources/resource_manager.h" |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 | 400 |
| 400 if (progress_bar_.get() && progress_bar_->parent()) | 401 if (progress_bar_.get() && progress_bar_->parent()) |
| 401 progress_bar_->RemoveFromParent(); | 402 progress_bar_->RemoveFromParent(); |
| 402 } | 403 } |
| 403 } | 404 } |
| 404 | 405 |
| 405 ContextualSearchLayer::ContextualSearchLayer( | 406 ContextualSearchLayer::ContextualSearchLayer( |
| 406 ui::ResourceManager* resource_manager) | 407 ui::ResourceManager* resource_manager) |
| 407 : OverlayPanelLayer(resource_manager), | 408 : OverlayPanelLayer(resource_manager), |
| 408 search_context_( | 409 search_context_( |
| 409 cc::UIResourceLayer::Create(content::Compositor::LayerSettings())), | 410 cc::UIResourceLayer::Create(cc::LayerSettings())), |
| 410 search_provider_icon_sprite_(CrushedSpriteLayer::Create()), | 411 search_provider_icon_sprite_(CrushedSpriteLayer::Create()), |
| 411 arrow_icon_( | 412 arrow_icon_( |
| 412 cc::UIResourceLayer::Create(content::Compositor::LayerSettings())), | 413 cc::UIResourceLayer::Create(cc::LayerSettings())), |
| 413 search_promo_( | 414 search_promo_( |
| 414 cc::UIResourceLayer::Create(content::Compositor::LayerSettings())), | 415 cc::UIResourceLayer::Create(cc::LayerSettings())), |
| 415 search_promo_container_( | 416 search_promo_container_( |
| 416 cc::SolidColorLayer::Create(content::Compositor::LayerSettings())), | 417 cc::SolidColorLayer::Create(cc::LayerSettings())), |
| 417 peek_promo_container_( | 418 peek_promo_container_( |
| 418 cc::SolidColorLayer::Create(content::Compositor::LayerSettings())), | 419 cc::SolidColorLayer::Create(cc::LayerSettings())), |
| 419 peek_promo_ripple_( | 420 peek_promo_ripple_( |
| 420 cc::NinePatchLayer::Create(content::Compositor::LayerSettings())), | 421 cc::NinePatchLayer::Create(cc::LayerSettings())), |
| 421 peek_promo_text_( | 422 peek_promo_text_( |
| 422 cc::UIResourceLayer::Create(content::Compositor::LayerSettings())), | 423 cc::UIResourceLayer::Create(cc::LayerSettings())), |
| 423 progress_bar_( | 424 progress_bar_( |
| 424 cc::NinePatchLayer::Create(content::Compositor::LayerSettings())), | 425 cc::NinePatchLayer::Create(cc::LayerSettings())), |
| 425 progress_bar_background_( | 426 progress_bar_background_( |
| 426 cc::NinePatchLayer::Create(content::Compositor::LayerSettings())) { | 427 cc::NinePatchLayer::Create(cc::LayerSettings())) { |
| 427 // Search Peek Promo | 428 // Search Peek Promo |
| 428 peek_promo_container_->SetIsDrawable(true); | 429 peek_promo_container_->SetIsDrawable(true); |
| 429 peek_promo_container_->SetBackgroundColor(kSearchBarBackgroundColor); | 430 peek_promo_container_->SetBackgroundColor(kSearchBarBackgroundColor); |
| 430 peek_promo_ripple_->SetIsDrawable(true); | 431 peek_promo_ripple_->SetIsDrawable(true); |
| 431 peek_promo_ripple_->SetFillCenter(true); | 432 peek_promo_ripple_->SetFillCenter(true); |
| 432 peek_promo_text_->SetIsDrawable(true); | 433 peek_promo_text_->SetIsDrawable(true); |
| 433 peek_promo_container_->AddChild(peek_promo_ripple_); | 434 peek_promo_container_->AddChild(peek_promo_ripple_); |
| 434 peek_promo_container_->AddChild(peek_promo_text_); | 435 peek_promo_container_->AddChild(peek_promo_text_); |
| 435 | 436 |
| 436 // Search Bar Text | 437 // Search Bar Text |
| (...skipping 17 matching lines...) Expand all Loading... |
| 454 // Progress Bar | 455 // Progress Bar |
| 455 progress_bar_->SetIsDrawable(true); | 456 progress_bar_->SetIsDrawable(true); |
| 456 progress_bar_->SetFillCenter(true); | 457 progress_bar_->SetFillCenter(true); |
| 457 } | 458 } |
| 458 | 459 |
| 459 ContextualSearchLayer::~ContextualSearchLayer() { | 460 ContextualSearchLayer::~ContextualSearchLayer() { |
| 460 } | 461 } |
| 461 | 462 |
| 462 } // namespace android | 463 } // namespace android |
| 463 } // namespace chrome | 464 } // namespace chrome |
| OLD | NEW |