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 #include "chrome/browser/ui/views/create_application_shortcut_view.h" | 5 #include "chrome/browser/ui/views/create_application_shortcut_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 canvas->sk_canvas()->drawRoundRect(inner_rect, SkDoubleToScalar(1.5), | 221 canvas->sk_canvas()->drawRoundRect(inner_rect, SkDoubleToScalar(1.5), |
222 SkDoubleToScalar(1.5), inner_paint); | 222 SkDoubleToScalar(1.5), inner_paint); |
223 } | 223 } |
224 | 224 |
225 } // namespace | 225 } // namespace |
226 | 226 |
227 namespace chrome { | 227 namespace chrome { |
228 | 228 |
229 void ShowCreateWebAppShortcutsDialog(gfx::NativeWindow parent_window, | 229 void ShowCreateWebAppShortcutsDialog(gfx::NativeWindow parent_window, |
230 content::WebContents* web_contents) { | 230 content::WebContents* web_contents) { |
231 views::Widget::CreateWindowWithParent( | 231 views::DialogDelegate::CreateDialogWidget( |
232 new CreateUrlApplicationShortcutView(web_contents), | 232 new CreateUrlApplicationShortcutView(web_contents), |
233 parent_window)->Show(); | 233 NULL, parent_window)->Show(); |
234 } | 234 } |
235 | 235 |
236 void ShowCreateChromeAppShortcutsDialog(gfx::NativeWindow parent_window, | 236 void ShowCreateChromeAppShortcutsDialog(gfx::NativeWindow parent_window, |
237 Profile* profile, | 237 Profile* profile, |
238 const extensions::Extension* app) { | 238 const extensions::Extension* app) { |
239 views::Widget::CreateWindowWithParent( | 239 views::DialogDelegate::CreateDialogWidget( |
240 new CreateChromeApplicationShortcutView(profile, app), | 240 new CreateChromeApplicationShortcutView(profile, app), |
241 parent_window)->Show(); | 241 NULL, parent_window)->Show(); |
242 } | 242 } |
243 | 243 |
244 } // namespace chrome | 244 } // namespace chrome |
245 | 245 |
246 CreateApplicationShortcutView::CreateApplicationShortcutView(Profile* profile) | 246 CreateApplicationShortcutView::CreateApplicationShortcutView(Profile* profile) |
247 : profile_(profile), | 247 : profile_(profile), |
248 app_info_(NULL), | 248 app_info_(NULL), |
249 create_shortcuts_label_(NULL), | 249 create_shortcuts_label_(NULL), |
250 desktop_check_box_(NULL), | 250 desktop_check_box_(NULL), |
251 menu_check_box_(NULL), | 251 menu_check_box_(NULL), |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 CreateChromeApplicationShortcutView::~CreateChromeApplicationShortcutView() {} | 531 CreateChromeApplicationShortcutView::~CreateChromeApplicationShortcutView() {} |
532 | 532 |
533 // Called when the app's ShortcutInfo (with icon) is loaded. | 533 // Called when the app's ShortcutInfo (with icon) is loaded. |
534 void CreateChromeApplicationShortcutView::OnShortcutInfoLoaded( | 534 void CreateChromeApplicationShortcutView::OnShortcutInfoLoaded( |
535 const ShellIntegration::ShortcutInfo& shortcut_info) { | 535 const ShellIntegration::ShortcutInfo& shortcut_info) { |
536 shortcut_info_ = shortcut_info; | 536 shortcut_info_ = shortcut_info; |
537 | 537 |
538 CHECK(app_info_); | 538 CHECK(app_info_); |
539 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); | 539 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); |
540 } | 540 } |
OLD | NEW |