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_APP_INFO_SUMMARY_PANEL_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_APPS_APP_INFO_DIALOG_APP_INFO_SUMMARY_PANEL_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_APPS_APP_INFO_DIALOG_APP_INFO_SUMMARY_PANEL_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_APPS_APP_INFO_DIALOG_APP_INFO_SUMMARY_PANEL_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | |
8 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | |
9 #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.h" | 11 #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.h" |
10 #include "chrome/common/extensions/extension_constants.h" | 12 #include "chrome/common/extensions/extension_constants.h" |
11 #include "ui/views/controls/combobox/combobox_listener.h" | 13 #include "ui/views/controls/combobox/combobox_listener.h" |
12 | 14 |
15 class AppSizeBuffer; | |
13 class LaunchOptionsComboboxModel; | 16 class LaunchOptionsComboboxModel; |
14 class Profile; | 17 class Profile; |
15 | 18 |
16 namespace extensions { | 19 namespace extensions { |
17 class Extension; | 20 class Extension; |
18 } | 21 } |
19 | 22 |
20 namespace views { | 23 namespace views { |
21 class Combobox; | 24 class Combobox; |
22 class Label; | 25 class Label; |
23 } | 26 } |
24 | 27 |
25 // The summary panel of the app info dialog, which provides basic information | 28 // The summary panel of the app info dialog, which provides basic information |
26 // and controls related to the app. | 29 // and controls related to the app. |
27 class AppInfoSummaryPanel : public AppInfoPanel, | 30 class AppInfoSummaryPanel : public AppInfoPanel, |
28 public views::ComboboxListener { | 31 public views::ComboboxListener, |
32 public base::SupportsWeakPtr<AppInfoSummaryPanel> { | |
29 public: | 33 public: |
30 AppInfoSummaryPanel(Profile* profile, const extensions::Extension* app); | 34 AppInfoSummaryPanel(Profile* profile, const extensions::Extension* app); |
31 | 35 |
32 virtual ~AppInfoSummaryPanel(); | 36 virtual ~AppInfoSummaryPanel(); |
33 | 37 |
34 private: | 38 private: |
35 // Internal initialisation methods. | 39 // Internal initialisation methods. |
36 void CreateDescriptionControl(); | 40 void CreateDescriptionControl(); |
37 void CreateDetailsControl(); | 41 void CreateDetailsControl(); |
38 void CreateLaunchOptionControl(); | 42 void CreateLaunchOptionControl(); |
39 | 43 |
40 void LayoutDescriptionControl(); | 44 void LayoutDescriptionControl(); |
41 void LayoutDetailsControl(); | 45 void LayoutDetailsControl(); |
42 | 46 |
43 // Overridden from views::ComboboxListener: | 47 // Overridden from views::ComboboxListener: |
44 virtual void OnPerformAction(views::Combobox* combobox) OVERRIDE; | 48 virtual void OnPerformAction(views::Combobox* combobox) OVERRIDE; |
45 | 49 |
50 // Called asynchronously to calculate and update the size of the app displayed | |
51 // in the dialog. | |
52 void StartCalculatingAppSize(); | |
53 void OnAppSizeCalculated(scoped_refptr<AppSizeBuffer> app_size_in_bytes); | |
54 | |
46 // Returns the time this app was installed. | 55 // Returns the time this app was installed. |
47 base::Time GetInstalledTime() const; | 56 base::Time GetInstalledTime() const; |
48 | 57 |
49 // Returns the time the app was last launched, or base::Time() if it's never | 58 // Returns the time the app was last launched, or base::Time() if it's never |
50 // been launched. | 59 // been launched. |
51 base::Time GetLastLaunchedTime() const; | 60 base::Time GetLastLaunchedTime() const; |
52 | 61 |
53 // Returns the launch type of the app (e.g. pinned tab, fullscreen, etc). | 62 // Returns the launch type of the app (e.g. pinned tab, fullscreen, etc). |
54 extensions::LaunchType GetLaunchType() const; | 63 extensions::LaunchType GetLaunchType() const; |
55 | 64 |
56 // Sets the launch type of the app to the given type. Must only be called if | 65 // Sets the launch type of the app to the given type. Must only be called if |
57 // CanSetLaunchType() returns true. | 66 // CanSetLaunchType() returns true. |
58 void SetLaunchType(extensions::LaunchType) const; | 67 void SetLaunchType(extensions::LaunchType) const; |
59 bool CanSetLaunchType() const; | 68 bool CanSetLaunchType() const; |
60 | 69 |
61 // UI elements on the dialog. | 70 // UI elements on the dialog. |
62 views::Label* description_heading_; | 71 views::Label* description_heading_; |
63 views::Label* description_label_; | 72 views::Label* description_label_; |
64 | 73 |
65 views::Label* details_heading_; | 74 views::Label* details_heading_; |
75 views::Label* size_title_; | |
76 views::Label* size_value_; | |
66 views::Label* version_title_; | 77 views::Label* version_title_; |
67 views::Label* version_value_; | 78 views::Label* version_value_; |
68 views::Label* installed_time_title_; | 79 views::Label* installed_time_title_; |
69 views::Label* installed_time_value_; | 80 views::Label* installed_time_value_; |
70 views::Label* last_run_time_title_; | 81 views::Label* last_run_time_title_; |
71 views::Label* last_run_time_value_; | 82 views::Label* last_run_time_value_; |
72 | 83 |
84 int64 app_size_in_bytes_; | |
tapted
2014/07/31 00:42:04
I don't think you use this
sashab
2014/07/31 05:00:46
Removed.
| |
85 | |
73 scoped_ptr<LaunchOptionsComboboxModel> launch_options_combobox_model_; | 86 scoped_ptr<LaunchOptionsComboboxModel> launch_options_combobox_model_; |
74 views::Combobox* launch_options_combobox_; | 87 views::Combobox* launch_options_combobox_; |
75 | 88 |
89 base::WeakPtrFactory<AppInfoSummaryPanel> weak_ptr_factory_; | |
90 | |
76 DISALLOW_COPY_AND_ASSIGN(AppInfoSummaryPanel); | 91 DISALLOW_COPY_AND_ASSIGN(AppInfoSummaryPanel); |
77 }; | 92 }; |
78 | 93 |
79 #endif // CHROME_BROWSER_UI_VIEWS_APPS_APP_INFO_DIALOG_APP_INFO_SUMMARY_PANEL_H _ | 94 #endif // CHROME_BROWSER_UI_VIEWS_APPS_APP_INFO_DIALOG_APP_INFO_SUMMARY_PANEL_H _ |
OLD | NEW |