| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_VIEWS_LOCAL_STORAGE_INFO_VIEW_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_LOCAL_STORAGE_SET_ITEM_INFO_VIEW_H_ |
| 6 #define CHROME_BROWSER_VIEWS_LOCAL_STORAGE_INFO_VIEW_H_ | 6 #define CHROME_BROWSER_VIEWS_LOCAL_STORAGE_SET_ITEM_INFO_VIEW_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/string16.h" |
| 11 #include "views/view.h" | 12 #include "views/view.h" |
| 12 #include "chrome/browser/browsing_data_local_storage_helper.h" | |
| 13 | 13 |
| 14 namespace views { | 14 namespace views { |
| 15 class Label; | 15 class Label; |
| 16 class Textfield; | 16 class Textfield; |
| 17 } | 17 } |
| 18 | 18 |
| 19 /////////////////////////////////////////////////////////////////////////////// | 19 /////////////////////////////////////////////////////////////////////////////// |
| 20 // LocalStorageInfoView | 20 // LocalStorageSetItemInfoView |
| 21 // | 21 // |
| 22 // Responsible for displaying a tabular grid of Local Storage information. | 22 // Responsible for displaying a tabular grid of Local Storage information when |
| 23 class LocalStorageInfoView : public views::View { | 23 // prompting for permission to set an item. |
| 24 class LocalStorageSetItemInfoView : public views::View { |
| 24 public: | 25 public: |
| 25 LocalStorageInfoView(); | 26 LocalStorageSetItemInfoView(); |
| 26 virtual ~LocalStorageInfoView(); | 27 virtual ~LocalStorageSetItemInfoView(); |
| 27 | 28 |
| 28 // Update the display from the specified Local Storage info. | 29 // Update the display from the specified Local Storage info. |
| 29 void SetLocalStorageInfo( | 30 void SetFields(const std::string& host, |
| 30 const BrowsingDataLocalStorageHelper::LocalStorageInfo& | 31 const string16& key, |
| 31 local_storage_info); | 32 const string16& value); |
| 32 | 33 |
| 33 // Clears the cookie display to indicate that no or multiple local storages | 34 // Clears the display to indicate that no or multiple local storages |
| 34 // are selected. | 35 // are selected. |
| 35 void ClearLocalStorageDisplay(); | 36 void ClearLocalStorageDisplay(); |
| 36 | 37 |
| 37 // Enables or disables the local storate property text fields. | 38 // Enables or disables the local storate property text fields. |
| 38 void EnableLocalStorageDisplay(bool enabled); | 39 void EnableLocalStorageDisplay(bool enabled); |
| 39 | 40 |
| 40 protected: | 41 protected: |
| 41 // views::View overrides: | 42 // views::View overrides: |
| 42 virtual void ViewHierarchyChanged( | 43 virtual void ViewHierarchyChanged( |
| 43 bool is_add, views::View* parent, views::View* child); | 44 bool is_add, views::View* parent, views::View* child); |
| 44 | 45 |
| 45 private: | 46 private: |
| 46 // Set up the view layout | 47 // Set up the view layout |
| 47 void Init(); | 48 void Init(); |
| 48 | 49 |
| 49 // Individual property labels | 50 // Individual property labels |
| 50 views::Textfield* origin_value_field_; | 51 views::Textfield* host_value_field_; |
| 51 views::Textfield* size_value_field_; | 52 views::Textfield* key_value_field_; |
| 52 views::Textfield* last_modified_value_field_; | 53 views::Textfield* value_value_field_; |
| 53 | 54 |
| 54 DISALLOW_COPY_AND_ASSIGN(LocalStorageInfoView); | 55 DISALLOW_COPY_AND_ASSIGN(LocalStorageSetItemInfoView); |
| 55 }; | 56 }; |
| 56 | 57 |
| 57 | 58 |
| 58 #endif // CHROME_BROWSER_VIEWS_LOCAL_STORAGE_INFO_VIEW_H_ | 59 #endif // CHROME_BROWSER_VIEWS_LOCAL_STORAGE_SET_ITEM_INFO_VIEW_H_ |
| 59 | 60 |
| OLD | NEW |