| OLD | NEW | 
|---|
| (Empty) |  | 
|  | 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 | 
|  | 3 // found in the LICENSE file. | 
|  | 4 | 
|  | 5 #include "chrome/browser/ui/views/frame/webapp_header_painter_ash.h" | 
|  | 6 | 
|  | 7 #include "ash/frame/caption_buttons/frame_caption_button.h" | 
|  | 8 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" | 
|  | 9 #include "grit/ash_resources.h" | 
|  | 10 #include "ui/views/widget/widget.h" | 
|  | 11 | 
|  | 12 /////////////////////////////////////////////////////////////////////////////// | 
|  | 13 // WebAppHeaderPainterAsh, public: | 
|  | 14 | 
|  | 15 WebAppHeaderPainterAsh::WebAppHeaderPainterAsh() | 
|  | 16     : ash::DefaultHeaderPainter(), | 
|  | 17       back_button_(NULL) { | 
|  | 18 } | 
|  | 19 | 
|  | 20 WebAppHeaderPainterAsh::~WebAppHeaderPainterAsh() { | 
|  | 21 } | 
|  | 22 | 
|  | 23 void WebAppHeaderPainterAsh::Init( | 
|  | 24     views::Widget* frame, | 
|  | 25     views::View* header_view, | 
|  | 26     ash::FrameCaptionButton* back_button, | 
|  | 27     ash::FrameCaptionButtonContainerView* caption_button_container) { | 
|  | 28   DefaultHeaderPainter::Init(frame, header_view, NULL, | 
|  | 29       caption_button_container); | 
|  | 30 | 
|  | 31   DCHECK(back_button); | 
|  | 32   back_button_ = back_button; | 
|  | 33 | 
|  | 34   back_button_->SetImages(ash::CAPTION_BUTTON_ICON_BACK, | 
|  | 35                           ash::FrameCaptionButton::ANIMATE_NO, | 
|  | 36                           IDR_AURA_WINDOW_CONTROL_ICON_BACK, | 
|  | 37                           IDR_AURA_WINDOW_CONTROL_ICON_BACK_I, | 
|  | 38                           IDR_AURA_WINDOW_CONTROL_BACKGROUND_H, | 
|  | 39                           IDR_AURA_WINDOW_CONTROL_BACKGROUND_P); | 
|  | 40 } | 
|  | 41 | 
|  | 42 /////////////////////////////////////////////////////////////////////////////// | 
|  | 43 // WebAppHeaderPainter, private: | 
|  | 44 | 
|  | 45 // ash::DefaultHeaderPainter: | 
|  | 46 void WebAppHeaderPainterAsh::LayoutHeader() { | 
|  | 47   DefaultHeaderPainter::LayoutHeader(); | 
|  | 48 | 
|  | 49   back_button_->Layout(); | 
|  | 50   gfx::Size back_button_size = back_button_->GetPreferredSize(); | 
|  | 51   back_button_->SetBounds( | 
|  | 52       0, 0, back_button_size.width(), back_button_size.height()); | 
|  | 53 } | 
|  | 54 | 
|  | 55 views::View* WebAppHeaderPainterAsh::GetViewToLeftOfTitle() const { | 
|  | 56   return back_button_; | 
|  | 57 } | 
| OLD | NEW | 
|---|