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.
5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_WEB_APP_LEFT_HEADER_VIEW_ASH_H_
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_WEB_APP_LEFT_HEADER_VIEW_ASH_H_
8 #include "ui/views/controls/button/button.h"
13 class FrameCaptionButton
;
20 // WebAppLeftHeaderView is a container view for any icons on the left of the
21 // frame used for web app style windows. It contains a back button and a
23 class WebAppLeftHeaderView
: public views::View
,
24 public views::ButtonListener
{
26 static const char kViewClassName
[];
28 explicit WebAppLeftHeaderView(BrowserView
* browser_view
);
29 ~WebAppLeftHeaderView() override
;
34 // Update whether to paint the header view as active or not.
35 void SetPaintAsActive(bool active
);
37 views::View
* GetLocationIconView() const;
40 FRIEND_TEST_ALL_PREFIXES(WebAppLeftHeaderViewTest
, BackButton
);
41 FRIEND_TEST_ALL_PREFIXES(WebAppLeftHeaderViewTest
, LocationIcon
);
44 const char* GetClassName() const override
;
46 // views::ButtonListener:
47 void ButtonPressed(views::Button
* sender
, const ui::Event
& event
) override
;
49 // Ask the browser to show the website settings dialog.
50 void ShowWebsiteSettings() const;
52 // Update the state of the back button.
53 void UpdateBackButtonState(bool enabled
);
55 // The BrowserView for the frame.
56 BrowserView
* browser_view_
;
59 ash::FrameCaptionButton
* back_button_
;
61 // The location icon indicator. Shows the connection security status and
62 // allows the user to bring up the website settings dialog.
63 ash::FrameCaptionButton
* location_icon_
;
65 DISALLOW_COPY_AND_ASSIGN(WebAppLeftHeaderView
);
68 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_WEB_APP_LEFT_HEADER_VIEW_ASH_H_