| 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 8d41f90211e907dcf366fdeeef0c83a2b322cdba..eeb7a6397010a2314a2a070aedbbc6b7e363e61b 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
|
| @@ -22,7 +22,7 @@ class Event;
|
| }
|
|
|
| namespace views {
|
| -class Label;
|
| +class GridLayout;
|
| class LabelButton;
|
| class View;
|
| }
|
| @@ -46,43 +46,47 @@ 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();
|
| + // Called in this order, these methods set-up, add permissions to, and layout
|
| + // the list of permissions.
|
| + void CreatePermissionsList();
|
| + void FillPermissionsList();
|
| + void LayoutPermissionsList();
|
| +
|
| + // Adds a bullet with the given |message| to the list of permissions.
|
| + // CreatePermissionsList() must be called before this method. Uses the given
|
| + // |elide_behavior|, unless |allow_multiline| is true (in which case
|
| + // multi-lined items are allowed and no eliding occurs). If |revoke_button| is
|
| + // not NULL, adds |revoke_button| to the right of the bullet.
|
| + void AddPermissionBullet(bool nested_bullet,
|
| + const base::string16& message,
|
| + bool allow_multiline,
|
| + gfx::ElideBehavior elide_behavior,
|
| + views::LabelButton* revoke_button);
|
|
|
| // Overridden from views::ButtonListener.
|
| virtual void ButtonPressed(views::Button* sender,
|
| const ui::Event& event) override;
|
|
|
| + 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* active_permissions_heading_;
|
| - views::View* active_permissions_list_;
|
| + // The number of permissions that have been added to the list.
|
| + int permissions_list_count_;
|
|
|
| - views::Label* retained_files_heading_;
|
| - views::View* retained_files_list_;
|
| + // UI elements on the dialog.
|
| + views::View* permissions_list_;
|
| + views::GridLayout* permissions_list_layout_;
|
| 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);
|
|
|