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