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

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

Issue 661353002: Merged permissions in the App Info dialog into a single list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@work_towards_app_info_ui_review
Patch Set: Review feedback. Abstracted most of the permissions list into its own BulletedPermissionsList class. Created 6 years, 2 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_permissions_panel.h
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.h b/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.h
index 7f46fe715ffa4630f586d6b837f3f7b46474b2b0..e2ee263a151e0b6f73d982dbf2017ccb42aff332 100644
--- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.h
+++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.h
@@ -9,7 +9,6 @@
#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.h"
#include "ui/gfx/text_constants.h"
-#include "ui/views/controls/button/button.h"
class Profile;
@@ -22,15 +21,14 @@ class Event;
}
namespace views {
-class Label;
+class GridLayout;
class LabelButton;
benwells 2014/10/23 00:38:33 Nit: LabelButton forward decl isn't needed any mor
sashab 2014/10/23 01:57:04 Done.
class View;
}
// The summary panel of the app info dialog, which provides basic information
// and controls related to the app.
-class AppInfoPermissionsPanel : public AppInfoPanel,
- public views::ButtonListener {
+class AppInfoPermissionsPanel : public AppInfoPanel {
public:
AppInfoPermissionsPanel(Profile* profile, const extensions::Extension* app);
@@ -46,45 +44,25 @@ class AppInfoPermissionsPanel : public AppInfoPanel,
FRIEND_TEST_ALL_PREFIXES(AppInfoPermissionsPanelTest,
RetainedFilePermissionsObtainedCorrectly);
- // Given a list of strings, returns a view containing a list of these strings
- // as bulleted items with the given |elide_behavior|. If |allow_multiline| is
- // true, allow multi-lined bulleted items and ignore the |elide_behavior|.
- views::View* CreateBulletedListView(
- const std::vector<base::string16>& messages,
- bool allow_multiline,
- gfx::ElideBehavior elide_behavior);
-
- // Internal initialisation methods.
- void CreateActivePermissionsControl();
- void CreateRetainedFilesControl();
- void CreateRetainedDevicesControl();
-
- void LayoutActivePermissionsControl();
- void LayoutRetainedFilesControl();
- void LayoutRetainedDevicesControl();
-
- // Overridden from views::ButtonListener.
- virtual void ButtonPressed(views::Button* sender,
- const ui::Event& event) override;
+ // Called in this order, these methods set-up, add permissions to, and layout
+ // the list of permissions.
+ void CreatePermissionsList();
+ void FillPermissionsList();
+ void LayoutPermissionsList();
+ int GetActivePermissionMessagesCount() const;
const std::vector<base::string16> GetActivePermissionMessages() const;
+
+ int GetRetainedFileCount() const;
+ base::string16 GetRetainedFileHeading() const;
const std::vector<base::string16> GetRetainedFilePaths() const;
void RevokeFilePermissions();
+
+ int GetRetainedDeviceCount() const;
+ base::string16 GetRetainedDeviceHeading() const;
const std::vector<base::string16> GetRetainedDevices() const;
void RevokeDevicePermissions();
- // UI elements on the dialog.
- views::Label* permissions_heading_;
- views::View* permissions_list_;
-
- views::Label* retained_files_heading_;
- views::View* retained_files_list_;
- views::LabelButton* revoke_file_permissions_button_;
-
- views::Label* retained_devices_heading_;
- views::View* retained_devices_list_;
- views::LabelButton* revoke_device_permissions_button_;
-
DISALLOW_COPY_AND_ASSIGN(AppInfoPermissionsPanel);
};

Powered by Google App Engine
This is Rietveld 408576698