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