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

Unified Diff: chrome/browser/ui/views/frame/webapp_header_painter_ash.cc

Issue 441803004: Introduce new WebApp header style for hosted apps and fizzy apps on ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Feedback Created 6 years, 4 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/ui/views/frame/webapp_header_painter_ash.cc
diff --git a/chrome/browser/ui/views/frame/webapp_header_painter_ash.cc b/chrome/browser/ui/views/frame/webapp_header_painter_ash.cc
new file mode 100644
index 0000000000000000000000000000000000000000..670bed6c6afe429524867905559b8e6f64d9cb9f
--- /dev/null
+++ b/chrome/browser/ui/views/frame/webapp_header_painter_ash.cc
@@ -0,0 +1,57 @@
+// Copyright 2014 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/ui/views/frame/webapp_header_painter_ash.h"
+
+#include "ash/frame/caption_buttons/frame_caption_button.h"
+#include "ash/frame/caption_buttons/frame_caption_button_container_view.h"
+#include "grit/ash_resources.h"
+#include "ui/views/widget/widget.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// WebAppHeaderPainterAsh, public:
+
+WebAppHeaderPainterAsh::WebAppHeaderPainterAsh()
+ : ash::DefaultHeaderPainter(),
+ back_button_(NULL) {
+}
+
+WebAppHeaderPainterAsh::~WebAppHeaderPainterAsh() {
+}
+
+void WebAppHeaderPainterAsh::InitForWebApp(
+ views::Widget* frame,
+ views::View* header_view,
+ ash::FrameCaptionButton* back_button,
+ ash::FrameCaptionButtonContainerView* caption_button_container) {
+ DefaultHeaderPainter::Init(frame, header_view, NULL,
+ caption_button_container);
+
+ DCHECK(back_button);
+ back_button_ = back_button;
+
+ back_button_->SetImages(ash::CAPTION_BUTTON_ICON_BACK,
+ ash::FrameCaptionButton::ANIMATE_NO,
+ IDR_AURA_WINDOW_CONTROL_ICON_BACK,
+ IDR_AURA_WINDOW_CONTROL_ICON_BACK_I,
+ IDR_AURA_WINDOW_CONTROL_BACKGROUND_H,
+ IDR_AURA_WINDOW_CONTROL_BACKGROUND_P);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// WebAppHeaderPainter, private:
+
+// ash::DefaultHeaderPainter:
+void WebAppHeaderPainterAsh::LayoutHeader() {
+ DefaultHeaderPainter::LayoutHeader();
+
+ back_button_->Layout();
+ gfx::Size back_button_size = back_button_->GetPreferredSize();
+ back_button_->SetBounds(
+ 0, 0, back_button_size.width(), back_button_size.height());
+}
+
+views::View* WebAppHeaderPainterAsh::GetViewToLeftOfTitle() const {
+ return back_button_;
+}

Powered by Google App Engine
This is Rietveld 408576698