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

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

Issue 335523002: Re-styled App Info Dialog according to UI feedback 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes, and removed border either side of the horizontal rules (doesn't match mocks anyway) 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_summary_panel.cc
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_panel.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_panel.cc
index 1f04cba6e3c6567d3b9ad1ec8db6cf96c4b513a2..3a638f206bd0c5f1656a623e8dc3795615669949 100644
--- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_panel.cc
+++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_panel.cc
@@ -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
-}
« no previous file with comments | « chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_panel.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698