1// Copyright (c) 2010 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#ifndef CHROME_BROWSER_UI_VIEWS_LOCAL_STORAGE_INFO_VIEW_H_
6#define CHROME_BROWSER_UI_VIEWS_LOCAL_STORAGE_INFO_VIEW_H_
7#pragma once
8
9#include "views/view.h"
10#include "chrome/browser/browsing_data_local_storage_helper.h"
11
12namespace views {
13class Label;
14class Textfield;
15}
16
17///////////////////////////////////////////////////////////////////////////////
18// LocalStorageInfoView
19//
20//  Responsible for displaying a tabular grid of Local Storage information.
21class LocalStorageInfoView : public views::View {
22 public:
23  LocalStorageInfoView();
24  virtual ~LocalStorageInfoView();
25
26  // Update the display from the specified Local Storage info.
27  void SetLocalStorageInfo(
28      const BrowsingDataLocalStorageHelper::LocalStorageInfo&
29      local_storage_info);
30
31  // Clears the cookie display to indicate that no or multiple local storages
32  // are selected.
33  void ClearLocalStorageDisplay();
34
35  // Enables or disables the local storate property text fields.
36  void EnableLocalStorageDisplay(bool enabled);
37
38 protected:
39  // views::View overrides:
40  virtual void ViewHierarchyChanged(
41      bool is_add, views::View* parent, views::View* child);
42
43 private:
44  // Set up the view layout
45  void Init();
46
47  // Individual property labels
48  views::Textfield* origin_value_field_;
49  views::Textfield* size_value_field_;
50  views::Textfield* last_modified_value_field_;
51
52  DISALLOW_COPY_AND_ASSIGN(LocalStorageInfoView);
53};
54
55
56#endif  // CHROME_BROWSER_UI_VIEWS_LOCAL_STORAGE_INFO_VIEW_H_
57
58