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

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

Issue 1861233003: Prepare for building with enable_app_list=0 on Desktop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase for r392580 - app_list_shower_views_unittest deleted by that rev Created 4 years, 7 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_footer_panel.cc
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc
index a4b856260cb7cda2ddf0665ad8924ade3c901547..c412b0cac69fc4f87d81cc6d6d80e6ad278d1621 100644
--- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc
+++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc
@@ -5,7 +5,6 @@
#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/grit/generated_resources.h"
@@ -59,6 +58,7 @@ void AppInfoFooterPanel::CreateButtons() {
create_shortcuts_button_->SetStyle(views::Button::STYLE_BUTTON);
}
+#if defined(USE_ASH)
if (CanSetPinnedToShelf()) {
pin_to_shelf_button_ = new views::LabelButton(
this, l10n_util::GetStringUTF16(IDS_APP_LIST_CONTEXT_MENU_PIN));
@@ -67,6 +67,7 @@ void AppInfoFooterPanel::CreateButtons() {
this, l10n_util::GetStringUTF16(IDS_APP_LIST_CONTEXT_MENU_UNPIN));
unpin_from_shelf_button_->SetStyle(views::Button::STYLE_BUTTON);
}
+#endif
if (CanUninstallApp()) {
remove_button_ = new views::LabelButton(
@@ -111,10 +112,12 @@ void AppInfoFooterPanel::ButtonPressed(views::Button* sender,
const ui::Event& event) {
if (sender == create_shortcuts_button_) {
CreateShortcuts();
+#if defined(USE_ASH)
} else if (sender == pin_to_shelf_button_) {
SetPinnedToShelf(true);
} else if (sender == unpin_from_shelf_button_) {
SetPinnedToShelf(false);
+#endif
} else if (sender == remove_button_) {
UninstallApp();
} else {
@@ -151,8 +154,8 @@ bool AppInfoFooterPanel::CanCreateShortcuts() const {
#endif // USE_ASH
}
-void AppInfoFooterPanel::SetPinnedToShelf(bool value) {
#if defined(USE_ASH)
+void AppInfoFooterPanel::SetPinnedToShelf(bool value) {
DCHECK(CanSetPinnedToShelf());
ash::ShelfDelegate* shelf_delegate =
ash::Shell::GetInstance()->GetShelfDelegate();
@@ -164,13 +167,9 @@ void AppInfoFooterPanel::SetPinnedToShelf(bool value) {
UpdatePinButtons(true);
Layout();
-#else
- NOTREACHED();
-#endif
}
bool AppInfoFooterPanel::CanSetPinnedToShelf() const {
-#if defined(USE_ASH)
// Non-Ash platforms don't have a shelf.
if (!ash::Shell::HasInstance())
return false;
@@ -180,10 +179,8 @@ bool AppInfoFooterPanel::CanSetPinnedToShelf() const {
(!ChromeLauncherController::instance() ||
ChromeLauncherController::instance()->GetPinnable(app_->id()) ==
AppListControllerDelegate::PIN_EDITABLE);
-#else
- return false;
-#endif
}
+#endif // USE_ASH
void AppInfoFooterPanel::UninstallApp() {
DCHECK(CanUninstallApp());
« no previous file with comments | « chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.h ('k') | chrome/chrome_browser_extensions.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698