Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2159)

Unified Diff: chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc

Issue 327743002: Re-styled the App Info Dialog according to UI feedback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc
index cb2498f064fd0b0bb7c51e04ae8b3d8bc4df0205..9ac7f2709cf59b2d3f62cdd2f8c2191f1045d522 100644
--- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc
+++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc
@@ -4,17 +4,16 @@
#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.h"
-#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_manage_tab.h"
-#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_tab.h"
-#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_tab.h"
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_details_panel.h"
+#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_panel.h"
#include "chrome/browser/ui/views/constrained_window_views.h"
-#include "grit/generated_resources.h"
-#include "ui/base/l10n/l10n_util.h"
-#include "ui/views/controls/tabbed_pane/tabbed_pane.h"
-#include "ui/views/layout/fill_layout.h"
-#include "ui/views/layout/layout_manager.h"
+#include "ui/gfx/geometry/rect.h"
+#include "ui/gfx/geometry/size.h"
+#include "ui/views/border.h"
+#include "ui/views/controls/scroll_view.h"
+#include "ui/views/layout/box_layout.h"
#include "ui/views/widget/widget.h"
-#include "ui/views/window/dialog_delegate.h"
void ShowAppInfoDialog(gfx::NativeWindow parent_window,
const gfx::Rect& dialog_widget_bounds,
@@ -36,19 +35,29 @@ AppInfoDialog::AppInfoDialog(gfx::NativeWindow parent_window,
profile_(profile),
app_(app),
close_callback_(close_callback) {
- SetLayoutManager(new views::FillLayout());
+ // The width of this margin determines the spacing either side of the
+ // horizontal line underneath the summary panel.
+ const int kHorizontalBorderSpacing = 1;
+ SetLayoutManager(new views::BoxLayout(
+ views::BoxLayout::kVertical, kHorizontalBorderSpacing, 0, 0));
+ AppInfoSummaryPanel* app_summary_panel =
+ new AppInfoSummaryPanel(parent_window_, profile_, app_, close_callback_);
+ app_summary_panel->SetBorder(
+ views::Border::CreateSolidSidedBorder(0, 0, 2, 0, SK_ColorLTGRAY));
- views::TabbedPane* tabbed_pane = new views::TabbedPane();
- AddChildView(tabbed_pane);
+ // Clip the scrollable view so that the scrollbar appears. As long as this
+ // is larger than the height of the dialog, it will be resized to the dialog's
+ // actual height.
+ // TODO(sashab): Add ClipHeight() as a parameter-less method to
+ // views::ScrollView(), which mimics this behaviour.
+ const int kMaxDialogHeight = 1000;
+ views::ScrollView* app_details_scrollview = new views::ScrollView();
+ app_details_scrollview->ClipHeightTo(kMaxDialogHeight, kMaxDialogHeight);
+ app_details_scrollview->SetContents(
+ new AppInfoDetailsPanel(parent_window_, profile_, app_));
- tabbed_pane->AddTab(
- l10n_util::GetStringUTF16(IDS_APPLICATION_INFO_SUMMARY_TAB_TITLE),
- new AppInfoSummaryTab(parent_window_, profile_, app_, close_callback_));
- tabbed_pane->AddTab(
- l10n_util::GetStringUTF16(IDS_APPLICATION_INFO_PERMISSIONS_TAB_TITLE),
- new AppInfoPermissionsTab(
- parent_window_, profile_, app_, close_callback_));
- // TODO(sashab): Add the manage tab back once there is content for it.
+ AddChildView(app_summary_panel);
+ AddChildView(app_details_scrollview);
}
AppInfoDialog::~AppInfoDialog() {}

Powered by Google App Engine
This is Rietveld 408576698