Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Unified Diff: chrome/browser/android/compositor/resources/toolbar_resource.cc

Issue 2752693003: chrome/android: Update toolbar drawing in native. (Closed)
Patch Set: .. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/compositor/resources/toolbar_resource.cc
diff --git a/chrome/browser/android/compositor/resources/toolbar_resource.cc b/chrome/browser/android/compositor/resources/toolbar_resource.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c3173a3bd6c3cbc0e41e61b039f264f1126d7db3
--- /dev/null
+++ b/chrome/browser/android/compositor/resources/toolbar_resource.cc
@@ -0,0 +1,32 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/android/compositor/resources/toolbar_resource.h"
+
+#include "base/memory/ptr_util.h"
+
+namespace android {
+
+// static
+ToolbarResource* ToolbarResource::From(ui::Resource* resource) {
+ DCHECK_EQ(Type::TOOLBAR, resource->type());
+ return static_cast<ToolbarResource*>(resource);
+}
+
+ToolbarResource::ToolbarResource(gfx::Rect toolbar_rect,
+ gfx::Rect location_bar_content_rect,
+ int shadow_height)
+ : Resource(Type::TOOLBAR),
+ toolbar_rect_(toolbar_rect),
+ location_bar_content_rect_(location_bar_content_rect),
+ shadow_height_(shadow_height) {}
+
+ToolbarResource::~ToolbarResource() = default;
+
+std::unique_ptr<ui::Resource> ToolbarResource::CreateForCopy() {
+ return base::MakeUnique<ToolbarResource>(
+ toolbar_rect_, location_bar_content_rect_, shadow_height_);
+}
+
+} // namespace android

Powered by Google App Engine
This is Rietveld 408576698