Commit 5039aa43 authored by tfarina@chromium.org's avatar tfarina@chromium.org

views: Remove unused indexed_db_info_view files.

R=pkasting@chromium.org
TBR=ben@chromium.org
NOTRY=True

Review URL: https://chromiumcodereview.appspot.com/10826162

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150553 0039d316-1c4b-4281-b951-d872f2087c98
parent 1d7d4346
// Copyright (c) 2012 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.
#include "chrome/browser/ui/views/indexed_db_info_view.h"
#include <algorithm>
#include "base/i18n/time_formatting.h"
#include "base/utf_string_conversions.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/text/bytes_formatting.h"
#include "ui/gfx/color_utils.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/layout/grid_layout.h"
#include "ui/views/layout/layout_constants.h"
static const int kIndexedDBInfoViewBorderSize = 1;
static const int kIndexedDBInfoViewInsetSize = 3;
///////////////////////////////////////////////////////////////////////////////
// IndexedDBInfoView, public:
IndexedDBInfoView::IndexedDBInfoView()
: origin_value_field_(NULL),
size_value_field_(NULL),
last_modified_value_field_(NULL) {
}
IndexedDBInfoView::~IndexedDBInfoView() {
}
void IndexedDBInfoView::SetIndexedDBInfo(
const BrowsingDataIndexedDBHelper::IndexedDBInfo& indexed_db_info) {
origin_value_field_->SetText(UTF8ToUTF16(indexed_db_info.origin.spec()));
size_value_field_->SetText(ui::FormatBytes(indexed_db_info.size));
last_modified_value_field_->SetText(
base::TimeFormatFriendlyDateAndTime(indexed_db_info.last_modified));
EnableIndexedDBDisplay(true);
}
void IndexedDBInfoView::EnableIndexedDBDisplay(bool enabled) {
origin_value_field_->SetEnabled(enabled);
size_value_field_->SetEnabled(enabled);
last_modified_value_field_->SetEnabled(enabled);
}
void IndexedDBInfoView::ClearIndexedDBDisplay() {
const string16 no_cookie_string =
l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_NONESELECTED);
origin_value_field_->SetText(no_cookie_string);
size_value_field_->SetText(no_cookie_string);
last_modified_value_field_->SetText(no_cookie_string);
EnableIndexedDBDisplay(false);
}
///////////////////////////////////////////////////////////////////////////////
// IndexedDBInfoView, views::View overrides:
void IndexedDBInfoView::ViewHierarchyChanged(bool is_add,
views::View* parent,
views::View* child) {
if (is_add && child == this)
Init();
}
///////////////////////////////////////////////////////////////////////////////
// IndexedDBInfoView, private:
void IndexedDBInfoView::Init() {
SkColor border_color = color_utils::GetSysSkColor(COLOR_3DSHADOW);
views::Border* border = views::Border::CreateSolidBorder(
kIndexedDBInfoViewBorderSize, border_color);
set_border(border);
views::Label* origin_label = new views::Label(
l10n_util::GetStringUTF16(IDS_COOKIES_LOCAL_STORAGE_ORIGIN_LABEL));
origin_value_field_ = new views::Textfield;
views::Label* size_label = new views::Label(
l10n_util::GetStringUTF16(IDS_COOKIES_LOCAL_STORAGE_SIZE_ON_DISK_LABEL));
size_value_field_ = new views::Textfield;
views::Label* last_modified_label = new views::Label(
l10n_util::GetStringUTF16(
IDS_COOKIES_LOCAL_STORAGE_LAST_MODIFIED_LABEL));
last_modified_value_field_ = new views::Textfield;
using views::GridLayout;
GridLayout* layout = new GridLayout(this);
layout->SetInsets(kIndexedDBInfoViewInsetSize,
kIndexedDBInfoViewInsetSize,
kIndexedDBInfoViewInsetSize,
kIndexedDBInfoViewInsetSize);
SetLayoutManager(layout);
int three_column_layout_id = 0;
views::ColumnSet* column_set = layout->AddColumnSet(three_column_layout_id);
column_set->AddColumn(GridLayout::TRAILING, GridLayout::CENTER, 0,
GridLayout::USE_PREF, 0, 0);
column_set->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing);
column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1,
GridLayout::USE_PREF, 0, 0);
layout->StartRow(0, three_column_layout_id);
layout->AddView(origin_label);
layout->AddView(origin_value_field_);
layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing);
layout->StartRow(0, three_column_layout_id);
layout->AddView(size_label);
layout->AddView(size_value_field_);
layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing);
layout->StartRow(0, three_column_layout_id);
layout->AddView(last_modified_label);
layout->AddView(last_modified_value_field_);
// Color these borderless text areas the same as the containing dialog.
SkColor text_area_background = color_utils::GetSysSkColor(COLOR_3DFACE);
// Now that the Textfields are in the view hierarchy, we can initialize them.
origin_value_field_->SetReadOnly(true);
origin_value_field_->RemoveBorder();
origin_value_field_->SetBackgroundColor(text_area_background);
size_value_field_->SetReadOnly(true);
size_value_field_->RemoveBorder();
size_value_field_->SetBackgroundColor(text_area_background);
last_modified_value_field_->SetReadOnly(true);
last_modified_value_field_->RemoveBorder();
last_modified_value_field_->SetBackgroundColor(text_area_background);
}
// Copyright (c) 2012 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_INDEXED_DB_INFO_VIEW_H_
#define CHROME_BROWSER_UI_VIEWS_INDEXED_DB_INFO_VIEW_H_
#include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h"
#include "ui/views/view.h"
namespace views {
class Textfield;
}
///////////////////////////////////////////////////////////////////////////////
// IndexedDBInfoView
//
// Responsible for displaying a tabular grid of IndexedDB information.
class IndexedDBInfoView : public views::View {
public:
IndexedDBInfoView();
virtual ~IndexedDBInfoView();
// Update the display from the specified Local Storage info.
void SetIndexedDBInfo(
const BrowsingDataIndexedDBHelper::IndexedDBInfo&
indexed_db_info);
// Clears the cookie display to indicate that no or multiple local storages
// are selected.
void ClearIndexedDBDisplay();
// Enables or disables the local storate property text fields.
void EnableIndexedDBDisplay(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(IndexedDBInfoView);
};
#endif // CHROME_BROWSER_UI_VIEWS_INDEXED_DB_INFO_VIEW_H_
...@@ -3732,8 +3732,6 @@ ...@@ -3732,8 +3732,6 @@
'browser/ui/views/importer/import_lock_dialog_view.h', 'browser/ui/views/importer/import_lock_dialog_view.h',
'browser/ui/views/importer/import_progress_dialog_view.cc', 'browser/ui/views/importer/import_progress_dialog_view.cc',
'browser/ui/views/importer/import_progress_dialog_view.h', 'browser/ui/views/importer/import_progress_dialog_view.h',
'browser/ui/views/indexed_db_info_view.cc',
'browser/ui/views/indexed_db_info_view.h',
'browser/ui/views/infobars/after_translate_infobar.cc', 'browser/ui/views/infobars/after_translate_infobar.cc',
'browser/ui/views/infobars/after_translate_infobar.h', 'browser/ui/views/infobars/after_translate_infobar.h',
'browser/ui/views/infobars/before_translate_infobar.cc', 'browser/ui/views/infobars/before_translate_infobar.cc',
...@@ -5272,8 +5270,6 @@ ...@@ -5272,8 +5270,6 @@
['exclude', '^browser/platform_util_common_linux.cc'], ['exclude', '^browser/platform_util_common_linux.cc'],
['exclude', '^browser/ui/views/frame/app_panel_browser_frame_view.cc'], ['exclude', '^browser/ui/views/frame/app_panel_browser_frame_view.cc'],
['exclude', '^browser/ui/views/frame/app_panel_browser_frame_view.h'], ['exclude', '^browser/ui/views/frame/app_panel_browser_frame_view.h'],
['exclude', '^browser/ui/views/indexed_db_info_view.cc'],
['exclude', '^browser/ui/views/indexed_db_info_view.h'],
['exclude', '^browser/ui/views/theme_helpers.cc'], ['exclude', '^browser/ui/views/theme_helpers.cc'],
['exclude', '^browser/ui/views/theme_helpers.h'], ['exclude', '^browser/ui/views/theme_helpers.h'],
['exclude', '^browser/ui/views/uninstall_view.cc'], ['exclude', '^browser/ui/views/uninstall_view.cc'],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment