Home | History | Annotate | Download | only in views
      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_SET_ITEM_INFO_VIEW_H_
      6 #define CHROME_BROWSER_UI_VIEWS_LOCAL_STORAGE_SET_ITEM_INFO_VIEW_H_
      7 #pragma once
      8 
      9 #include <string>
     10 
     11 #include "base/string16.h"
     12 #include "views/view.h"
     13 
     14 namespace views {
     15 class Label;
     16 class Textfield;
     17 }
     18 
     19 ///////////////////////////////////////////////////////////////////////////////
     20 // LocalStorageSetItemInfoView
     21 //
     22 //  Responsible for displaying a tabular grid of Local Storage information when
     23 //  prompting for permission to set an item.
     24 class LocalStorageSetItemInfoView : public views::View {
     25  public:
     26   LocalStorageSetItemInfoView();
     27   virtual ~LocalStorageSetItemInfoView();
     28 
     29   // Update the display from the specified Local Storage info.
     30   void SetFields(const std::string& host,
     31                  const string16& key,
     32                  const string16& value);
     33 
     34   // Clears the display to indicate that no or multiple local storages
     35   // are selected.
     36   void ClearLocalStorageDisplay();
     37 
     38   // Enables or disables the local storate property text fields.
     39   void EnableLocalStorageDisplay(bool enabled);
     40 
     41  protected:
     42   // views::View overrides:
     43   virtual void ViewHierarchyChanged(
     44       bool is_add, views::View* parent, views::View* child);
     45 
     46  private:
     47   // Set up the view layout
     48   void Init();
     49 
     50   // Individual property labels
     51   views::Textfield* host_value_field_;
     52   views::Textfield* key_value_field_;
     53   views::Textfield* value_value_field_;
     54 
     55   DISALLOW_COPY_AND_ASSIGN(LocalStorageSetItemInfoView);
     56 };
     57 
     58 
     59 #endif  // CHROME_BROWSER_UI_VIEWS_LOCAL_STORAGE_SET_ITEM_INFO_VIEW_H_
     60 
     61