OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/android/compositor/resources/toolbar_resource.h" |
| 6 |
| 7 #include "base/memory/ptr_util.h" |
| 8 |
| 9 namespace android { |
| 10 |
| 11 // static |
| 12 ToolbarResource* ToolbarResource::From(ui::Resource* resource) { |
| 13 DCHECK_EQ(Type::TOOLBAR, resource->type()); |
| 14 return static_cast<ToolbarResource*>(resource); |
| 15 } |
| 16 |
| 17 ToolbarResource::ToolbarResource(gfx::Rect toolbar_rect, |
| 18 gfx::Rect location_bar_content_rect, |
| 19 int shadow_height) |
| 20 : Resource(Type::TOOLBAR), |
| 21 toolbar_rect_(toolbar_rect), |
| 22 location_bar_content_rect_(location_bar_content_rect), |
| 23 shadow_height_(shadow_height) {} |
| 24 |
| 25 ToolbarResource::~ToolbarResource() = default; |
| 26 |
| 27 std::unique_ptr<ui::Resource> ToolbarResource::CreateForCopy() { |
| 28 return base::MakeUnique<ToolbarResource>( |
| 29 toolbar_rect_, location_bar_content_rect_, shadow_height_); |
| 30 } |
| 31 |
| 32 } // namespace android |
OLD | NEW |