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