OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #import "base/mac/scoped_nsobject.h" | 7 #import "base/mac/scoped_nsobject.h" |
8 #import "chrome/browser/web_applications/web_app_mac.h" | 8 #import "chrome/browser/web_applications/web_app_mac.h" |
9 #import "ui/base/l10n/l10n_util_mac.h" | 9 #import "ui/base/l10n/l10n_util_mac.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 @end | 55 @end |
56 | 56 |
57 namespace { | 57 namespace { |
58 | 58 |
59 // Called when the app's ShortcutInfo (with icon) is loaded when creating app | 59 // Called when the app's ShortcutInfo (with icon) is loaded when creating app |
60 // shortcuts. | 60 // shortcuts. |
61 void CreateAppShortcutInfoLoaded( | 61 void CreateAppShortcutInfoLoaded( |
62 Profile* profile, | 62 Profile* profile, |
63 const extensions::Extension* app, | 63 const extensions::Extension* app, |
64 const base::Callback<void(bool)>& close_callback, | 64 const base::Callback<void(bool)>& close_callback, |
65 std::unique_ptr<web_app::ShortcutInfo> shortcut_info) { | 65 scoped_refptr<web_app::ShortcutInfo> shortcut_info) { |
66 base::scoped_nsobject<NSAlert> alert([[NSAlert alloc] init]); | 66 base::scoped_nsobject<NSAlert> alert([[NSAlert alloc] init]); |
67 | 67 |
68 NSButton* continue_button = [alert | 68 NSButton* continue_button = [alert |
69 addButtonWithTitle:l10n_util::GetNSString(IDS_CREATE_SHORTCUTS_COMMIT)]; | 69 addButtonWithTitle:l10n_util::GetNSString(IDS_CREATE_SHORTCUTS_COMMIT)]; |
70 [continue_button setKeyEquivalent:kKeyEquivalentReturn]; | 70 [continue_button setKeyEquivalent:kKeyEquivalentReturn]; |
71 | 71 |
72 NSButton* cancel_button = | 72 NSButton* cancel_button = |
73 [alert addButtonWithTitle:l10n_util::GetNSString(IDS_CANCEL)]; | 73 [alert addButtonWithTitle:l10n_util::GetNSString(IDS_CANCEL)]; |
74 [cancel_button setKeyEquivalent:kKeyEquivalentEscape]; | 74 [cancel_button setKeyEquivalent:kKeyEquivalentEscape]; |
75 | 75 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 gfx::NativeWindow /*parent_window*/, | 126 gfx::NativeWindow /*parent_window*/, |
127 Profile* profile, | 127 Profile* profile, |
128 const extensions::Extension* app, | 128 const extensions::Extension* app, |
129 const base::Callback<void(bool)>& close_callback) { | 129 const base::Callback<void(bool)>& close_callback) { |
130 web_app::GetShortcutInfoForApp( | 130 web_app::GetShortcutInfoForApp( |
131 app, profile, | 131 app, profile, |
132 base::Bind(&CreateAppShortcutInfoLoaded, profile, app, close_callback)); | 132 base::Bind(&CreateAppShortcutInfoLoaded, profile, app, close_callback)); |
133 } | 133 } |
134 | 134 |
135 } // namespace chrome | 135 } // namespace chrome |
OLD | NEW |