Commit f307e1a9 authored by sashab@chromium.org's avatar sashab@chromium.org

Re-styled App Info Dialog according to UI feedback 2

Re-styled the App Info Dialog again according to new UI feedback. This
involves moving the 'Remove' and 'Create Shortcuts' buttons into a new
AppInfoFooterPanel, which is displayed at the bottom of the app info
dialog.

Depends on review https://codereview.chromium.org/327743002/.

BUG=266739

Review URL: https://codereview.chromium.org/335523002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278072 0039d316-1c4b-4281-b951-d872f2087c98
parent b6641db6
......@@ -7,15 +7,18 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
#include "chrome/browser/ui/views/app_list/app_list_dialog_contents_view.h"
#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.h"
#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_header_panel.h"
#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_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 "ui/app_list/app_list_constants.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/layout/grid_layout.h"
#include "ui/views/layout/layout_constants.h"
#include "ui/views/widget/widget.h"
......@@ -36,41 +39,59 @@ void ShowAppInfoDialog(AppListControllerDelegate* app_list_controller_delegate,
dialog_widget->Show();
}
AppInfoDialog::AppInfoDialog(Profile* profile,
const extensions::Extension* app) {
// The width of this margin determines the spacing either side of the
// horizontal separator underneath the summary panel.
const int kHorizontalBorderSpacing = 1;
const int kHorizontalSeparatorHeight = 2;
SetLayoutManager(new views::BoxLayout(
views::BoxLayout::kVertical, kHorizontalBorderSpacing, 0, 0));
AppInfoHeaderPanel* dialog_header = new AppInfoHeaderPanel(profile, app);
dialog_header->SetBorder(views::Border::CreateSolidSidedBorder(
0, 0, kHorizontalSeparatorHeight, 0, SK_ColorLTGRAY));
AppInfoDialog::AppInfoDialog(Profile* profile, const extensions::Extension* app)
: dialog_header_(NULL), dialog_body_(NULL), dialog_footer_(NULL) {
views::GridLayout* layout = new views::GridLayout(this);
SetLayoutManager(layout);
// Create one column that fills the whole dialog.
int kColumnSetId = 1;
views::ColumnSet* column_set = layout->AddColumnSet(kColumnSetId);
column_set->AddColumn(views::GridLayout::FILL,
views::GridLayout::FILL,
1, // Stretch the column to the width of the dialog.
views::GridLayout::USE_PREF,
0,
0);
const int kHorizontalSeparatorHeight = 1;
dialog_header_ = new AppInfoHeaderPanel(profile, app);
dialog_header_->SetBorder(views::Border::CreateSolidSidedBorder(
0, 0, kHorizontalSeparatorHeight, 0, app_list::kDialogSeparatorColor));
dialog_footer_ = new AppInfoFooterPanel(profile, app);
dialog_footer_->SetBorder(views::Border::CreateSolidSidedBorder(
kHorizontalSeparatorHeight, 0, 0, 0, app_list::kDialogSeparatorColor));
// Make a vertically stacked view of all the panels we want to display in the
// dialog.
views::View* dialog_body = new views::View();
dialog_body->SetLayoutManager(
views::View* dialog_body_contents = new views::View();
dialog_body_contents->SetLayoutManager(
new views::BoxLayout(views::BoxLayout::kVertical,
views::kButtonHEdgeMarginNew,
views::kPanelVertMargin,
views::kUnrelatedControlVerticalSpacing));
dialog_body->AddChildView(new AppInfoSummaryPanel(profile, app));
dialog_body->AddChildView(new AppInfoPermissionsPanel(profile, app));
dialog_body_contents->AddChildView(new AppInfoSummaryPanel(profile, app));
dialog_body_contents->AddChildView(new AppInfoPermissionsPanel(profile, app));
// 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.
// views::ScrollView() to mimic this behaviour.
const int kMaxDialogHeight = 1000;
views::ScrollView* dialog_body_scrollview = new views::ScrollView();
dialog_body_scrollview->ClipHeightTo(kMaxDialogHeight, kMaxDialogHeight);
dialog_body_scrollview->SetContents(dialog_body);
dialog_body_ = new views::ScrollView();
dialog_body_->ClipHeightTo(kMaxDialogHeight, kMaxDialogHeight);
dialog_body_->SetContents(dialog_body_contents);
layout->StartRow(0, kColumnSetId);
layout->AddView(dialog_header_);
layout->StartRow(1, kColumnSetId);
layout->AddView(dialog_body_);
AddChildView(dialog_header);
AddChildView(dialog_body_scrollview);
layout->StartRow(0, kColumnSetId);
layout->AddView(dialog_footer_);
}
AppInfoDialog::~AppInfoDialog() {
......
......@@ -13,6 +13,10 @@ namespace extensions {
class Extension;
}
namespace views {
class ScrollView;
}
// View the information about a particular chrome application.
class AppInfoDialog : public views::View {
......@@ -21,6 +25,11 @@ class AppInfoDialog : public views::View {
virtual ~AppInfoDialog();
private:
// UI elements of the dialog.
views::View* dialog_header_;
views::ScrollView* dialog_body_;
views::View* dialog_footer_;
DISALLOW_COPY_AND_ASSIGN(AppInfoDialog);
};
......
// Copyright 2014 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/apps/app_info_dialog/app_info_footer_panel.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/management_policy.h"
#include "extensions/common/extension.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/events/event.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/layout_constants.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
AppInfoFooterPanel::AppInfoFooterPanel(Profile* profile,
const extensions::Extension* app)
: AppInfoPanel(profile, app),
create_shortcuts_button_(NULL),
remove_button_(NULL),
weak_ptr_factory_(this) {
CreateButtons();
SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal,
views::kButtonHEdgeMargin,
views::kButtonVEdgeMargin,
views::kRelatedButtonHSpacing));
LayoutButtons();
}
AppInfoFooterPanel::~AppInfoFooterPanel() {
}
void AppInfoFooterPanel::CreateButtons() {
if (CanCreateShortcuts()) {
create_shortcuts_button_ = new views::LabelButton(
this,
l10n_util::GetStringUTF16(
IDS_APPLICATION_INFO_CREATE_SHORTCUTS_BUTTON_TEXT));
create_shortcuts_button_->SetStyle(views::Button::STYLE_BUTTON);
}
if (CanUninstallApp()) {
remove_button_ = new views::LabelButton(
this,
l10n_util::GetStringUTF16(IDS_APPLICATION_INFO_UNINSTALL_BUTTON_TEXT));
remove_button_->SetStyle(views::Button::STYLE_BUTTON);
}
}
void AppInfoFooterPanel::LayoutButtons() {
if (create_shortcuts_button_)
AddChildView(create_shortcuts_button_);
if (remove_button_)
AddChildView(remove_button_);
}
void AppInfoFooterPanel::ButtonPressed(views::Button* sender,
const ui::Event& event) {
if (sender == create_shortcuts_button_) {
CreateShortcuts();
} else if (sender == remove_button_) {
UninstallApp();
} else {
NOTREACHED();
}
}
void AppInfoFooterPanel::ExtensionUninstallAccepted() {
ExtensionService* service =
extensions::ExtensionSystem::Get(profile_)->extension_service();
service->UninstallExtension(app_->id(), false, NULL);
// Close the App Info dialog as well (which will free the dialog too).
GetWidget()->Close();
}
void AppInfoFooterPanel::ExtensionUninstallCanceled() {
extension_uninstall_dialog_.reset();
}
void AppInfoFooterPanel::CreateShortcuts() {
DCHECK(CanCreateShortcuts());
chrome::ShowCreateChromeAppShortcutsDialog(GetWidget()->GetNativeWindow(),
profile_,
app_,
base::Callback<void(bool)>());
}
bool AppInfoFooterPanel::CanCreateShortcuts() const {
// ChromeOS can pin apps to the app launcher, but can't create shortcuts.
#if defined(OS_CHROMEOS)
return false;
#else
return true;
#endif
}
void AppInfoFooterPanel::UninstallApp() {
DCHECK(CanUninstallApp());
extension_uninstall_dialog_.reset(
extensions::ExtensionUninstallDialog::Create(profile_, NULL, this));
extension_uninstall_dialog_->ConfirmUninstall(app_);
}
bool AppInfoFooterPanel::CanUninstallApp() const {
return extensions::ExtensionSystem::Get(profile_)
->management_policy()
->UserMayModifySettings(app_, NULL);
}
// Copyright 2014 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_APPS_APP_INFO_DIALOG_APP_INFO_FOOTER_PANEL_H_
#define CHROME_BROWSER_UI_VIEWS_APPS_APP_INFO_DIALOG_APP_INFO_FOOTER_PANEL_H_
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/extensions/extension_uninstall_dialog.h"
#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.h"
#include "ui/views/controls/button/button.h"
class Profile;
namespace extensions {
class Extension;
}
namespace ui {
class Event;
}
namespace views {
class LabelButton;
}
// A small summary panel with buttons to control the app that is displayed at
// the bottom of the app info dialog.
class AppInfoFooterPanel
: public AppInfoPanel,
public views::ButtonListener,
public extensions::ExtensionUninstallDialog::Delegate,
public base::SupportsWeakPtr<AppInfoFooterPanel> {
public:
AppInfoFooterPanel(Profile* profile, const extensions::Extension* app);
virtual ~AppInfoFooterPanel();
private:
void CreateButtons();
void LayoutButtons();
// Overridden from views::ButtonListener:
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) OVERRIDE;
// Overridden from ExtensionUninstallDialog::Delegate:
virtual void ExtensionUninstallAccepted() OVERRIDE;
virtual void ExtensionUninstallCanceled() OVERRIDE;
// Create Shortcuts for the app. Must only be called if CanCreateShortcuts()
// returns true.
void CreateShortcuts();
bool CanCreateShortcuts() const;
// Uninstall the app. Must only be called if CanUninstallApp() returns true.
void UninstallApp();
bool CanUninstallApp() const;
// UI elements on the dialog. Elements are NULL if they are not displayed.
views::LabelButton* create_shortcuts_button_;
views::LabelButton* remove_button_;
scoped_ptr<extensions::ExtensionUninstallDialog> extension_uninstall_dialog_;
base::WeakPtrFactory<AppInfoFooterPanel> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(AppInfoFooterPanel);
};
#endif // CHROME_BROWSER_UI_VIEWS_APPS_APP_INFO_DIALOG_APP_INFO_FOOTER_PANEL_H_
......@@ -4,12 +4,9 @@
#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_header_panel.h"
#include <vector>
#include "base/bind.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_uninstall_dialog.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/extensions/image_loader.h"
#include "chrome/browser/profiles/profile.h"
......@@ -17,7 +14,6 @@
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/manifest_url_handler.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/management_policy.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_icon_set.h"
......@@ -41,7 +37,7 @@
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/grid_layout.h"
#include "ui/views/layout/layout_constants.h"
#include "ui/views/widget/widget.h"
#include "ui/views/view.h"
#include "url/gurl.h"
// Size of extension icon in top left of dialog.
......@@ -54,7 +50,6 @@ AppInfoHeaderPanel::AppInfoHeaderPanel(Profile* profile,
app_name_label_(NULL),
app_version_label_(NULL),
view_in_store_link_(NULL),
remove_link_(NULL),
licenses_link_(NULL),
weak_ptr_factory_(this) {
CreateControls();
......@@ -96,13 +91,6 @@ void AppInfoHeaderPanel::CreateControls() {
view_in_store_link_->set_listener(this);
}
if (CanUninstallApp()) {
remove_link_ = new views::Link(
l10n_util::GetStringUTF16(IDS_APPLICATION_INFO_UNINSTALL_BUTTON_TEXT));
remove_link_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
remove_link_->set_listener(this);
}
if (CanDisplayLicenses()) {
licenses_link_ = new views::Link(
l10n_util::GetStringUTF16(IDS_APPLICATION_INFO_LICENSES_BUTTON_TEXT));
......@@ -168,8 +156,6 @@ void AppInfoHeaderPanel::LayoutControls() {
new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 3));
if (view_in_store_link_)
horizontal_links_container->AddChildView(view_in_store_link_);
if (remove_link_)
horizontal_links_container->AddChildView(remove_link_);
if (licenses_link_)
horizontal_links_container->AddChildView(licenses_link_);
// First line: title and (possibly) version. Second line: links (if any).
......@@ -186,8 +172,6 @@ void AppInfoHeaderPanel::LayoutControls() {
void AppInfoHeaderPanel::LinkClicked(views::Link* source, int event_flags) {
if (source == view_in_store_link_) {
ShowAppInWebStore();
} else if (source == remove_link_) {
UninstallApp();
} else if (source == licenses_link_) {
DisplayLicenses();
} else {
......@@ -195,16 +179,6 @@ void AppInfoHeaderPanel::LinkClicked(views::Link* source, int event_flags) {
}
}
void AppInfoHeaderPanel::ExtensionUninstallAccepted() {
ExtensionService* service =
extensions::ExtensionSystem::Get(profile_)->extension_service();
service->UninstallExtension(app_->id(), false, NULL);
// Close the App Info dialog as well (which will free the dialog too).
GetWidget()->Close();
}
void AppInfoHeaderPanel::ExtensionUninstallCanceled() {
extension_uninstall_dialog_.reset();
}
void AppInfoHeaderPanel::LoadAppImageAsync() {
extensions::ExtensionResource image = extensions::IconsInfo::GetIconResource(
app_,
......@@ -249,19 +223,6 @@ bool AppInfoHeaderPanel::CanShowAppInWebStore() const {
return app_->from_webstore();
}
void AppInfoHeaderPanel::UninstallApp() {
DCHECK(CanUninstallApp());
extension_uninstall_dialog_.reset(
extensions::ExtensionUninstallDialog::Create(profile_, NULL, this));
extension_uninstall_dialog_->ConfirmUninstall(app_);
}
bool AppInfoHeaderPanel::CanUninstallApp() const {
return extensions::ExtensionSystem::Get(profile_)
->management_policy()
->UserMayModifySettings(app_, NULL);
}
void AppInfoHeaderPanel::DisplayLicenses() {
// Find the first shared module for this app, and display it's options page
// as an 'about' link.
......
......@@ -5,14 +5,11 @@
#ifndef CHROME_BROWSER_UI_VIEWS_APPS_APP_INFO_DIALOG_APP_INFO_HEADER_PANEL_H_
#define CHROME_BROWSER_UI_VIEWS_APPS_APP_INFO_DIALOG_APP_INFO_HEADER_PANEL_H_
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/extensions/extension_uninstall_dialog.h"
#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.h"
#include "ui/views/controls/link_listener.h"
class Profile;
namespace extensions {
class Extension;
}
......@@ -25,15 +22,14 @@ namespace views {
class ImageView;
class Label;
class Link;
class View;
}
// A small summary panel with the app's name, icon, version, and various links
// that is displayed at the top of the app info dialog.
class AppInfoHeaderPanel
: public AppInfoPanel,
public views::LinkListener,
public extensions::ExtensionUninstallDialog::Delegate,
public base::SupportsWeakPtr<AppInfoHeaderPanel> {
class AppInfoHeaderPanel : public AppInfoPanel,
public views::LinkListener,
public base::SupportsWeakPtr<AppInfoHeaderPanel> {
public:
AppInfoHeaderPanel(Profile* profile, const extensions::Extension* app);
virtual ~AppInfoHeaderPanel();
......@@ -46,10 +42,6 @@ class AppInfoHeaderPanel
// Overridden from views::LinkListener:
virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE;
// Overridden from ExtensionUninstallDialog::Delegate:
virtual void ExtensionUninstallAccepted() OVERRIDE;
virtual void ExtensionUninstallCanceled() OVERRIDE;
// Load the app icon asynchronously. For the response, check OnAppImageLoaded.
void LoadAppImageAsync();
// Called when the app's icon is loaded.
......@@ -60,10 +52,6 @@ class AppInfoHeaderPanel
void ShowAppInWebStore() const;
bool CanShowAppInWebStore() const;
// Uninstall the app. Must only be called if CanUninstallApp() returns true.
void UninstallApp();
bool CanUninstallApp() const;
// Displays the licenses for the app. Must only be called if
// CanDisplayLicenses() returns true.
void DisplayLicenses();
......@@ -74,11 +62,8 @@ class AppInfoHeaderPanel
views::Label* app_name_label_;
views::Label* app_version_label_;
views::Link* view_in_store_link_;
views::Link* remove_link_;
views::Link* licenses_link_;
scoped_ptr<extensions::ExtensionUninstallDialog> extension_uninstall_dialog_;
base::WeakPtrFactory<AppInfoHeaderPanel> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(AppInfoHeaderPanel);
......
......@@ -13,7 +13,6 @@
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/launch_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/common/chrome_switches.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_system.h"
......@@ -21,8 +20,6 @@
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/combobox_model.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/controls/combobox/combobox.h"
#include "ui/views/controls/label.h"
#include "ui/views/layout/box_layout.h"
......@@ -133,7 +130,6 @@ AppInfoSummaryPanel::AppInfoSummaryPanel(Profile* profile,
// Create UI elements.
CreateDescriptionControl();
CreateLaunchOptionControl();
CreateShortcutsButton();
// Layout elements.
SetLayoutManager(
......@@ -146,8 +142,6 @@ AppInfoSummaryPanel::AppInfoSummaryPanel(Profile* profile,
if (launch_options_combobox_)
AddChildView(launch_options_combobox_);
LayoutShortcutsButton();
}
AppInfoSummaryPanel::~AppInfoSummaryPanel() {
......@@ -185,16 +179,6 @@ void AppInfoSummaryPanel::CreateLaunchOptionControl() {
}
}
void AppInfoSummaryPanel::CreateShortcutsButton() {
if (CanCreateShortcuts()) {
create_shortcuts_button_ = new views::LabelButton(
this,
l10n_util::GetStringUTF16(
IDS_APPLICATION_INFO_CREATE_SHORTCUTS_BUTTON_TEXT));
create_shortcuts_button_->SetStyle(views::Button::STYLE_BUTTON);
}
}
void AppInfoSummaryPanel::LayoutDescriptionControl() {
if (description_label_) {
DCHECK(description_heading_);
......@@ -205,18 +189,6 @@ void AppInfoSummaryPanel::LayoutDescriptionControl() {
}
}
void AppInfoSummaryPanel::LayoutShortcutsButton() {
if (create_shortcuts_button_) {
// Add a sub-view so the shortcuts button is left-aligned.
views::View* left_aligned_button = new views::View();
left_aligned_button->SetLayoutManager(
new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0));
left_aligned_button->AddChildView(create_shortcuts_button_);
AddChildView(left_aligned_button);
}
}
void AppInfoSummaryPanel::OnPerformAction(views::Combobox* combobox) {
if (combobox == launch_options_combobox_) {
SetLaunchType(launch_options_combobox_model_->GetLaunchTypeAtIndex(
......@@ -226,15 +198,6 @@ void AppInfoSummaryPanel::OnPerformAction(views::Combobox* combobox) {
}
}
void AppInfoSummaryPanel::ButtonPressed(views::Button* sender,
const ui::Event& event) {
if (sender == create_shortcuts_button_) {
CreateShortcuts();
} else {
NOTREACHED();
}
}
extensions::LaunchType AppInfoSummaryPanel::GetLaunchType() const {
return extensions::GetLaunchType(extensions::ExtensionPrefs::Get(profile_),
app_);
......@@ -252,20 +215,3 @@ bool AppInfoSummaryPanel::CanSetLaunchType() const {
// V2 apps don't have a launch type.
return !app_->is_platform_app();
}
void AppInfoSummaryPanel::CreateShortcuts() {
DCHECK(CanCreateShortcuts());
chrome::ShowCreateChromeAppShortcutsDialog(GetWidget()->GetNativeWindow(),
profile_,
app_,
base::Callback<void(bool)>());
}
bool AppInfoSummaryPanel::CanCreateShortcuts() const {
// ChromeOS can pin apps to the app launcher, but can't create shortcuts.
#if defined(OS_CHROMEOS)
return false;
#else
return true;
#endif
}
......@@ -8,7 +8,6 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.h"
#include "chrome/common/extensions/extension_constants.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/combobox/combobox_listener.h"
class LaunchOptionsComboboxModel;
......@@ -18,21 +17,15 @@ namespace extensions {
class Extension;
}
namespace ui {
class Event;
}
namespace views {
class Combobox;
class Label;
class LabelButton;
}
// The summary panel of the app info dialog, which provides basic information
// and controls related to the app.
class AppInfoSummaryPanel : public AppInfoPanel,
public views::ComboboxListener,
public views::ButtonListener {
public views::ComboboxListener {
public:
AppInfoSummaryPanel(Profile* profile, const extensions::Extension* app);
......@@ -42,18 +35,11 @@ class AppInfoSummaryPanel : public AppInfoPanel,
// Internal initialisation methods.
void CreateDescriptionControl();
void CreateLaunchOptionControl();
void CreateShortcutsButton();
void LayoutDescriptionControl();
void LayoutShortcutsButton();
// Overridden from views::ComboboxListener:
virtual void OnPerformAction(views::Combobox* combobox) OVERRIDE;
// Overridden from views::ButtonListener.
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) OVERRIDE;
// Returns the launch type of the app (e.g. pinned tab, fullscreen, etc).
extensions::LaunchType GetLaunchType() const;
......@@ -62,17 +48,10 @@ class AppInfoSummaryPanel : public AppInfoPanel,
void SetLaunchType(extensions::LaunchType) const;
bool CanSetLaunchType() const;
// Create Shortcuts for the app. Must only be called if CanCreateShortcuts()
// returns true.
void CreateShortcuts();
bool CanCreateShortcuts() const;
// UI elements on the dialog.
views::Label* description_heading_;
views::Label* description_label_;
views::LabelButton* create_shortcuts_button_;
scoped_ptr<LaunchOptionsComboboxModel> launch_options_combobox_model_;
views::Combobox* launch_options_combobox_;
......
......@@ -1475,6 +1475,8 @@
'browser/ui/views/app_list/win/app_list_win.h',
'browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc',
'browser/ui/views/apps/app_info_dialog/app_info_dialog_views.h',
'browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc',
'browser/ui/views/apps/app_info_dialog/app_info_footer_panel.h',
'browser/ui/views/apps/app_info_dialog/app_info_header_panel.cc',
'browser/ui/views/apps/app_info_dialog/app_info_header_panel.h',
'browser/ui/views/apps/app_info_dialog/app_info_panel.cc',
......
......@@ -12,6 +12,9 @@ const SkColor kSearchBoxBackground = SK_ColorWHITE;
const SkColor kTopSeparatorColor = SkColorSetRGB(0xE5, 0xE5, 0xE5);
const SkColor kBottomSeparatorColor = SkColorSetRGB(0xE5, 0xE5, 0xE5);
// The color of the separator used inside dialogs in the app list.
const SkColor kDialogSeparatorColor = SkColorSetRGB(0xD1, 0xD1, 0xD1);
// 6% black over kContentsBackgroundColor
const SkColor kHighlightedColor = SkColorSetRGB(0xE6, 0xE6, 0xE6);
// 10% black over kContentsBackgroundColor
......
......@@ -17,6 +17,7 @@ APP_LIST_EXPORT extern const SkColor kContentsSwitcherBackgroundColor;
APP_LIST_EXPORT extern const SkColor kSearchBoxBackground;
APP_LIST_EXPORT extern const SkColor kTopSeparatorColor;
APP_LIST_EXPORT extern const SkColor kBottomSeparatorColor;
APP_LIST_EXPORT extern const SkColor kDialogSeparatorColor;
APP_LIST_EXPORT extern const SkColor kHighlightedColor;
APP_LIST_EXPORT extern const SkColor kSelectedColor;
......
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