Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
|
Matt Giuca
2014/03/04 01:36:57
CL description:
The description seems to be out o
sashab
2014/03/04 04:10:58
Done
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_APPS_APP_INFO_DIALOG_VIEWS_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_APPS_APP_INFO_DIALOG_VIEWS_H_ | |
| 7 | |
| 8 #include "base/compiler_specific.h" | |
| 9 #include "chrome/browser/shell_integration.h" | |
| 10 #include "ui/message_center/views/bounded_scroll_view.h" | |
| 11 #include "ui/views/controls/image_view.h" | |
| 12 #include "ui/views/window/dialog_delegate.h" | |
| 13 | |
| 14 class Profile; | |
| 15 | |
| 16 namespace extensions { | |
| 17 class Extension; | |
| 18 } | |
| 19 | |
| 20 namespace views { | |
| 21 class Label; | |
| 22 } | |
| 23 | |
| 24 // A scrollable list of permissions for the given app. | |
| 25 class PermissionsScrollView : public message_center::BoundedScrollView { | |
| 26 public: | |
| 27 PermissionsScrollView(int min_height, | |
| 28 int max_height, | |
| 29 const extensions::Extension* app); | |
| 30 | |
| 31 private: | |
| 32 virtual ~PermissionsScrollView(); | |
| 33 | |
| 34 views::View* inner_scrollable_view; | |
| 35 }; | |
| 36 | |
| 37 // View the information about a particular chrome application. | |
| 38 class AppInfoView : public views::DialogDelegateView, | |
| 39 public base::SupportsWeakPtr<AppInfoView> { | |
| 40 public: | |
| 41 AppInfoView(Profile* profile, | |
| 42 const extensions::Extension* app, | |
| 43 const base::Closure& close_callback); | |
| 44 | |
| 45 private: | |
| 46 virtual ~AppInfoView(); | |
| 47 | |
| 48 // Overridden from views::View: | |
| 49 virtual gfx::Size GetPreferredSize() OVERRIDE; | |
| 50 | |
| 51 // Overridden from views::DialogDelegate: | |
| 52 virtual bool Cancel() OVERRIDE; | |
| 53 virtual base::string16 GetDialogButtonLabel(ui::DialogButton button) | |
| 54 const OVERRIDE; | |
| 55 virtual int GetDialogButtons() const OVERRIDE; | |
| 56 virtual bool IsDialogButtonEnabled(ui::DialogButton button) const OVERRIDE; | |
| 57 | |
| 58 // Overridden from views::WidgetDelegate: | |
| 59 virtual ui::ModalType GetModalType() const OVERRIDE; | |
| 60 virtual base::string16 GetWindowTitle() const OVERRIDE; | |
| 61 | |
| 62 // Called when the app's icon is loaded. | |
| 63 void OnAppImageLoaded(const gfx::Image& image); | |
| 64 | |
| 65 // Profile in which the shortcuts will be created. | |
| 66 Profile* profile_; | |
| 67 | |
| 68 // UI elements on the dialog. | |
| 69 views::Label* app_name_label; | |
| 70 views::Label* app_description_label; | |
| 71 views::Label* app_version_label; | |
| 72 views::ImageView* app_icon; | |
| 73 views::Label* permission_list_heading; | |
| 74 PermissionsScrollView* permissions_scroll_view; | |
| 75 | |
| 76 const extensions::Extension* app_; | |
| 77 base::Closure close_callback_; | |
| 78 | |
| 79 base::WeakPtrFactory<AppInfoView> weak_ptr_factory_; | |
| 80 | |
| 81 DISALLOW_COPY_AND_ASSIGN(AppInfoView); | |
| 82 }; | |
| 83 | |
| 84 #endif // CHROME_BROWSER_UI_VIEWS_APPS_APP_INFO_DIALOG_VIEWS_H_ | |
| OLD | NEW |