Infobar material design refresh: layout
[chromium-blink-merge.git] / chrome / browser / ui / views / cookie_info_view.h
blobeed1ba96edc473b92801f112353389c3a9e62c42
1 // Copyright (c) 2012 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_COOKIE_INFO_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_COOKIE_INFO_VIEW_H_
8 #include <string>
9 #include <vector>
11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h"
13 #include "base/strings/string16.h"
14 #include "ui/views/view.h"
16 namespace views {
17 class GridLayout;
18 class Label;
19 class Textfield;
22 namespace net {
23 class CanonicalCookie;
26 ///////////////////////////////////////////////////////////////////////////////
27 // CookieInfoView
29 // Responsible for displaying a tabular grid of Cookie information.
30 class CookieInfoView : public views::View {
31 public:
32 CookieInfoView();
33 ~CookieInfoView() override;
35 // Update the display from the specified CookieNode.
36 void SetCookie(const std::string& domain,
37 const net::CanonicalCookie& cookie_node);
39 // Update the display from the specified cookie string.
40 void SetCookieString(const GURL& url, const std::string& cookie_line);
42 // Clears the cookie display to indicate that no or multiple cookies are
43 // selected.
44 void ClearCookieDisplay();
46 // Enables or disables the cookie property text fields.
47 void EnableCookieDisplay(bool enabled);
49 protected:
50 // views::View:
51 void ViewHierarchyChanged(
52 const ViewHierarchyChangedDetails& details) override;
54 private:
55 // Layout helper routines.
56 void AddLabelRow(int layout_id,
57 views::GridLayout* layout,
58 views::Label* label,
59 views::Textfield* textfield);
61 // Sets up the view layout.
62 void Init();
64 // Individual property labels
65 views::Label* name_label_;
66 views::Textfield* name_value_field_;
67 views::Label* content_label_;
68 views::Textfield* content_value_field_;
69 views::Label* domain_label_;
70 views::Textfield* domain_value_field_;
71 views::Label* path_label_;
72 views::Textfield* path_value_field_;
73 views::Label* send_for_label_;
74 views::Textfield* send_for_value_field_;
75 views::Label* created_label_;
76 views::Textfield* created_value_field_;
77 views::Label* expires_label_;
78 views::Textfield* expires_value_field_;
80 DISALLOW_COPY_AND_ASSIGN(CookieInfoView);
83 #endif // CHROME_BROWSER_UI_VIEWS_COOKIE_INFO_VIEW_H_