summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views/local_storage_info_view.h
blob: 3624a4dd7bbd461352e590019fd921efb16cea47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_UI_VIEWS_LOCAL_STORAGE_INFO_VIEW_H_
#define CHROME_BROWSER_UI_VIEWS_LOCAL_STORAGE_INFO_VIEW_H_

#include "chrome/browser/browsing_data_local_storage_helper.h"
#include "ui/views/view.h"

namespace views {
class Textfield;
}

///////////////////////////////////////////////////////////////////////////////
// LocalStorageInfoView
//
//  Responsible for displaying a tabular grid of Local Storage information.
class LocalStorageInfoView : public views::View {
 public:
  LocalStorageInfoView();
  virtual ~LocalStorageInfoView();

  // Update the display from the specified Local Storage info.
  void SetLocalStorageInfo(
      const BrowsingDataLocalStorageHelper::LocalStorageInfo&
      local_storage_info);

  // Clears the cookie display to indicate that no or multiple local storages
  // are selected.
  void ClearLocalStorageDisplay();

  // Enables or disables the local storate property text fields.
  void EnableLocalStorageDisplay(bool enabled);

 protected:
  // views::View overrides:
  virtual void ViewHierarchyChanged(
      bool is_add, views::View* parent, views::View* child);

 private:
  // Set up the view layout
  void Init();

  // Individual property labels
  views::Textfield* origin_value_field_;
  views::Textfield* size_value_field_;
  views::Textfield* last_modified_value_field_;

  DISALLOW_COPY_AND_ASSIGN(LocalStorageInfoView);
};


#endif  // CHROME_BROWSER_UI_VIEWS_LOCAL_STORAGE_INFO_VIEW_H_