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

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

Issue 340453004: Added Pin/Unpin button to the App Info Dialog on ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename fixes 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_footer_panel.h
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.h b/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.h
index 6a2aa1793127e928722fb65cb4b14ca498bcb948..47f09fe900e488bc0202bd4afe9851ff5380a94a 100644
--- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.h
+++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.h
@@ -9,6 +9,7 @@
#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/gfx/native_widget_types.h"
#include "ui/views/controls/button/button.h"
class Profile;
@@ -33,13 +34,19 @@ class AppInfoFooterPanel
public extensions::ExtensionUninstallDialog::Delegate,
public base::SupportsWeakPtr<AppInfoFooterPanel> {
public:
- AppInfoFooterPanel(Profile* profile, const extensions::Extension* app);
+ AppInfoFooterPanel(gfx::NativeWindow parent_window,
+ Profile* profile,
+ const extensions::Extension* app);
virtual ~AppInfoFooterPanel();
private:
void CreateButtons();
void LayoutButtons();
+ // Updates the visibility of the pin/unpin buttons so that only one is visible
+ // at a time.
+ void UpdatePinButtons();
+
// Overridden from views::ButtonListener:
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) OVERRIDE;
@@ -53,12 +60,21 @@ class AppInfoFooterPanel
void CreateShortcuts();
bool CanCreateShortcuts() const;
+ // Pins and unpins the app from the shelf. Must only be called if
+ // CanSetPinnedToShelf() returns true.
+ void SetPinnedToShelf(bool value);
+ bool CanSetPinnedToShelf() const;
+
// Uninstall the app. Must only be called if CanUninstallApp() returns true.
void UninstallApp();
bool CanUninstallApp() const;
+ gfx::NativeWindow parent_window_;
+
// UI elements on the dialog. Elements are NULL if they are not displayed.
views::LabelButton* create_shortcuts_button_;
+ views::LabelButton* pin_to_shelf_button_;
+ views::LabelButton* unpin_from_shelf_button_;
views::LabelButton* remove_button_;
scoped_ptr<extensions::ExtensionUninstallDialog> extension_uninstall_dialog_;

Powered by Google App Engine
This is Rietveld 408576698