Infobar material design refresh: layout
[chromium-blink-merge.git] / chrome / browser / ui / views / apps / app_info_dialog / app_info_panel.h
blob6cf33e130c049dfccdd995e0d856d64c017721b3
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_APPS_APP_INFO_DIALOG_APP_INFO_PANEL_H_
6 #define CHROME_BROWSER_UI_VIEWS_APPS_APP_INFO_DIALOG_APP_INFO_PANEL_H_
8 #include "ui/views/view.h"
10 class Profile;
12 namespace extensions {
13 class Extension;
15 namespace views {
16 class Label;
19 // A piece of the App Info dialog that displays information for a particular
20 // profile and app. Panels in the App Info dialog extend this class.
21 class AppInfoPanel : public views::View {
22 public:
23 AppInfoPanel(Profile* profile, const extensions::Extension* app);
25 ~AppInfoPanel() override;
27 protected:
28 // Closes the dialog.
29 void Close();
31 // Opens the given URL in a new browser tab.
32 void OpenLink(const GURL& url);
34 // Create a heading label with the given text.
35 views::Label* CreateHeading(const base::string16& text) const;
37 // Create a view with a vertically-stacked box layout, which can have child
38 // views appended to it. |child_spacing| defaults to
39 // |views::kRelatedControlVerticalSpacing|.
40 views::View* CreateVerticalStack(int child_spacing) const;
41 views::View* CreateVerticalStack() const;
43 // Create a view with a horizontally-stacked box layout, which can have child
44 // views appended to it.
45 views::View* CreateHorizontalStack(int child_spacing) const;
47 // Given a key and a value, displays them side-by-side as a field and its
48 // value.
49 views::View* CreateKeyValueField(views::View* key, views::View* value) const;
51 Profile* profile_;
52 const extensions::Extension* app_;
54 private:
55 DISALLOW_COPY_AND_ASSIGN(AppInfoPanel);
58 #endif // CHROME_BROWSER_UI_VIEWS_APPS_APP_INFO_DIALOG_APP_INFO_PANEL_H_