Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(517)

Side by Side Diff: chrome/browser/ui/views/create_application_shortcut_view.h

Issue 2721553002: Make web_app::ShortcutInfo RefCountedThreadSafe (1) (Closed)
Patch Set: TestBrowserThreadBundle for mac test fix Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 // UI elements on the dialog. 79 // UI elements on the dialog.
80 // 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.
81 views::View* app_info_; 81 views::View* app_info_;
82 views::Label* create_shortcuts_label_; 82 views::Label* create_shortcuts_label_;
83 views::Checkbox* desktop_check_box_; 83 views::Checkbox* desktop_check_box_;
84 views::Checkbox* menu_check_box_; 84 views::Checkbox* menu_check_box_;
85 views::Checkbox* quick_launch_check_box_; 85 views::Checkbox* quick_launch_check_box_;
86 86
87 // Target shortcut and file handler info. 87 // Target shortcut and file handler info.
88 std::unique_ptr<web_app::ShortcutInfo> shortcut_info_; 88 scoped_refptr<web_app::ShortcutInfo> shortcut_info_;
89 // 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.
90 bool create_in_chrome_apps_subdir_; 90 bool create_in_chrome_apps_subdir_;
91 91
92 DISALLOW_COPY_AND_ASSIGN(CreateApplicationShortcutView); 92 DISALLOW_COPY_AND_ASSIGN(CreateApplicationShortcutView);
93 }; 93 };
94 94
95 // Create an application shortcut pointing to a URL. 95 // Create an application shortcut pointing to a URL.
96 class CreateUrlApplicationShortcutView : public CreateApplicationShortcutView { 96 class CreateUrlApplicationShortcutView : public CreateApplicationShortcutView {
97 public: 97 public:
98 explicit CreateUrlApplicationShortcutView(content::WebContents* web_contents); 98 explicit CreateUrlApplicationShortcutView(content::WebContents* web_contents);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 CreateChromeApplicationShortcutView( 135 CreateChromeApplicationShortcutView(
136 Profile* profile, 136 Profile* profile,
137 const extensions::Extension* app, 137 const extensions::Extension* app,
138 const base::Callback<void(bool)>& close_callback); 138 const base::Callback<void(bool)>& close_callback);
139 ~CreateChromeApplicationShortcutView() override; 139 ~CreateChromeApplicationShortcutView() override;
140 bool Accept() override; 140 bool Accept() override;
141 bool Cancel() override; 141 bool Cancel() override;
142 142
143 private: 143 private:
144 // Called when the app's ShortcutInfo (with icon) is loaded. 144 // Called when the app's ShortcutInfo (with icon) is loaded.
145 void OnAppInfoLoaded(std::unique_ptr<web_app::ShortcutInfo> shortcut_info); 145 void OnAppInfoLoaded(scoped_refptr<web_app::ShortcutInfo> shortcut_info);
146 146
147 base::Callback<void(bool)> close_callback_; 147 base::Callback<void(bool)> close_callback_;
148 148
149 base::WeakPtrFactory<CreateChromeApplicationShortcutView> weak_ptr_factory_; 149 base::WeakPtrFactory<CreateChromeApplicationShortcutView> weak_ptr_factory_;
150 150
151 DISALLOW_COPY_AND_ASSIGN(CreateChromeApplicationShortcutView); 151 DISALLOW_COPY_AND_ASSIGN(CreateChromeApplicationShortcutView);
152 }; 152 };
153 153
154 #endif // CHROME_BROWSER_UI_VIEWS_CREATE_APPLICATION_SHORTCUT_VIEW_H_ 154 #endif // CHROME_BROWSER_UI_VIEWS_CREATE_APPLICATION_SHORTCUT_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698