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_DATABASE_INFO_VIEW_H_
      6 #define CHROME_BROWSER_UI_VIEWS_DATABASE_INFO_VIEW_H_
      7 #pragma once
      8 
      9 #include "views/view.h"
     10 #include "chrome/browser/browsing_data_database_helper.h"
     11 
     12 namespace views {
     13 class Label;
     14 class Textfield;
     15 }
     16 
     17 ///////////////////////////////////////////////////////////////////////////////
     18 // DatabaseInfoView
     19 //
     20 //  Responsible for displaying a tabular grid of Database information.
     21 class DatabaseInfoView : public views::View {
     22  public:
     23   DatabaseInfoView();
     24   virtual ~DatabaseInfoView();
     25 
     26   // Update the display from the specified Database info.
     27   void SetDatabaseInfo(
     28       const BrowsingDataDatabaseHelper::DatabaseInfo& database_info);
     29 
     30   // Clears the cookie display to indicate that no or multiple databases are
     31   // selected.
     32   void ClearDatabaseDisplay();
     33 
     34   // Enables or disables the database property text fields.
     35   void EnableDatabaseDisplay(bool enabled);
     36 
     37  protected:
     38   // views::View overrides:
     39   virtual void ViewHierarchyChanged(
     40       bool is_add, views::View* parent, views::View* child);
     41 
     42  private:
     43   // Set up the view layout.
     44   void Init();
     45 
     46   // Individual property labels.
     47   views::Textfield* name_value_field_;
     48   views::Textfield* description_value_field_;
     49   views::Textfield* size_value_field_;
     50   views::Textfield* last_modified_value_field_;
     51 
     52   DISALLOW_COPY_AND_ASSIGN(DatabaseInfoView);
     53 };
     54 
     55 
     56 #endif  // CHROME_BROWSER_UI_VIEWS_DATABASE_INFO_VIEW_H_
     57