OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CREATE_APPLICATION_SHORTCUT_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_CREATE_APPLICATION_SHORTCUT_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_CREATE_APPLICATION_SHORTCUT_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_CREATE_APPLICATION_SHORTCUT_VIEW_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/memory/scoped_ptr.h" |
13 #include "chrome/browser/web_applications/web_app.h" | 14 #include "chrome/browser/web_applications/web_app.h" |
14 #include "extensions/common/manifest_handlers/file_handler_info.h" | 15 #include "extensions/common/manifest_handlers/file_handler_info.h" |
15 #include "ui/views/controls/button/button.h" | 16 #include "ui/views/controls/button/button.h" |
16 #include "ui/views/window/dialog_delegate.h" | 17 #include "ui/views/window/dialog_delegate.h" |
17 | 18 |
18 class FaviconDownloadHelper; | 19 class FaviconDownloadHelper; |
19 class GURL; | 20 class GURL; |
20 class Profile; | 21 class Profile; |
21 class SkBitmap; | 22 class SkBitmap; |
22 | 23 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 80 |
80 // UI elements on the dialog. | 81 // UI elements on the dialog. |
81 // May be NULL if we are not displaying the app's info. | 82 // May be NULL if we are not displaying the app's info. |
82 views::View* app_info_; | 83 views::View* app_info_; |
83 views::Label* create_shortcuts_label_; | 84 views::Label* create_shortcuts_label_; |
84 views::Checkbox* desktop_check_box_; | 85 views::Checkbox* desktop_check_box_; |
85 views::Checkbox* menu_check_box_; | 86 views::Checkbox* menu_check_box_; |
86 views::Checkbox* quick_launch_check_box_; | 87 views::Checkbox* quick_launch_check_box_; |
87 | 88 |
88 // Target shortcut and file handler info. | 89 // Target shortcut and file handler info. |
89 web_app::ShortcutInfo shortcut_info_; | 90 scoped_ptr<web_app::ShortcutInfo> shortcut_info_; |
90 extensions::FileHandlersInfo file_handlers_info_; | 91 extensions::FileHandlersInfo file_handlers_info_; |
91 // If false, the shortcut will be created in the root level of the Start Menu. | 92 // If false, the shortcut will be created in the root level of the Start Menu. |
92 bool create_in_chrome_apps_subdir_; | 93 bool create_in_chrome_apps_subdir_; |
93 | 94 |
94 DISALLOW_COPY_AND_ASSIGN(CreateApplicationShortcutView); | 95 DISALLOW_COPY_AND_ASSIGN(CreateApplicationShortcutView); |
95 }; | 96 }; |
96 | 97 |
97 // Create an application shortcut pointing to a URL. | 98 // Create an application shortcut pointing to a URL. |
98 class CreateUrlApplicationShortcutView : public CreateApplicationShortcutView { | 99 class CreateUrlApplicationShortcutView : public CreateApplicationShortcutView { |
99 public: | 100 public: |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 Profile* profile, | 139 Profile* profile, |
139 const extensions::Extension* app, | 140 const extensions::Extension* app, |
140 const base::Callback<void(bool)>& close_callback); | 141 const base::Callback<void(bool)>& close_callback); |
141 ~CreateChromeApplicationShortcutView() override; | 142 ~CreateChromeApplicationShortcutView() override; |
142 bool Accept() override; | 143 bool Accept() override; |
143 bool Cancel() override; | 144 bool Cancel() override; |
144 | 145 |
145 private: | 146 private: |
146 // Called when the app's ShortcutInfo (with icon) and FileHandlersInfo is | 147 // Called when the app's ShortcutInfo (with icon) and FileHandlersInfo is |
147 // loaded. | 148 // loaded. |
148 void OnAppInfoLoaded(const web_app::ShortcutInfo& shortcut_info, | 149 void OnAppInfoLoaded(scoped_ptr<web_app::ShortcutInfo> shortcut_info, |
149 const extensions::FileHandlersInfo& file_handlers_info); | 150 const extensions::FileHandlersInfo& file_handlers_info); |
150 | 151 |
151 base::Callback<void(bool)> close_callback_; | 152 base::Callback<void(bool)> close_callback_; |
152 | 153 |
153 base::WeakPtrFactory<CreateChromeApplicationShortcutView> weak_ptr_factory_; | 154 base::WeakPtrFactory<CreateChromeApplicationShortcutView> weak_ptr_factory_; |
154 | 155 |
155 DISALLOW_COPY_AND_ASSIGN(CreateChromeApplicationShortcutView); | 156 DISALLOW_COPY_AND_ASSIGN(CreateChromeApplicationShortcutView); |
156 }; | 157 }; |
157 | 158 |
158 #endif // CHROME_BROWSER_UI_VIEWS_CREATE_APPLICATION_SHORTCUT_VIEW_H_ | 159 #endif // CHROME_BROWSER_UI_VIEWS_CREATE_APPLICATION_SHORTCUT_VIEW_H_ |
OLD | NEW |