OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extensions/bookmark_app_bubble_view.h" | 5 #include "chrome/browser/ui/views/extensions/bookmark_app_bubble_view.h" |
6 | 6 |
7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/extensions/app_icon_loader_impl.h" | 9 #include "chrome/browser/extensions/app_icon_loader_impl.h" |
10 #include "chrome/browser/extensions/bookmark_app_helper.h" | 10 #include "chrome/browser/extensions/bookmark_app_helper.h" |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 } | 200 } |
201 | 201 |
202 void BookmarkAppBubbleView::WindowClosing() { | 202 void BookmarkAppBubbleView::WindowClosing() { |
203 // We have to reset |bookmark_app_bubble_| here, not in our destructor, | 203 // We have to reset |bookmark_app_bubble_| here, not in our destructor, |
204 // because we'll be destroyed asynchronously and the shown state will be | 204 // because we'll be destroyed asynchronously and the shown state will be |
205 // checked before then. | 205 // checked before then. |
206 DCHECK_EQ(bookmark_app_bubble_, this); | 206 DCHECK_EQ(bookmark_app_bubble_, this); |
207 bookmark_app_bubble_ = NULL; | 207 bookmark_app_bubble_ = NULL; |
208 | 208 |
209 if (remove_app_) { | 209 if (remove_app_) { |
210 GetExtensionService(profile_)->UninstallExtension( | 210 GetExtensionService(profile_) |
211 extension_id_, extensions::UNINSTALL_REASON_INSTALL_CANCELED, NULL); | 211 ->UninstallExtension(extension_id_, |
| 212 extensions::UNINSTALL_REASON_INSTALL_CANCELED, |
| 213 base::Bind(&base::DoNothing), |
| 214 NULL); |
212 } else { | 215 } else { |
213 ApplyEdits(); | 216 ApplyEdits(); |
214 } | 217 } |
215 } | 218 } |
216 | 219 |
217 bool BookmarkAppBubbleView::AcceleratorPressed( | 220 bool BookmarkAppBubbleView::AcceleratorPressed( |
218 const ui::Accelerator& accelerator) { | 221 const ui::Accelerator& accelerator) { |
219 if (accelerator.key_code() == ui::VKEY_RETURN) { | 222 if (accelerator.key_code() == ui::VKEY_RETURN) { |
220 HandleButtonPressed(add_button_); | 223 HandleButtonPressed(add_button_); |
221 } | 224 } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 if (extension && base::UTF8ToUTF16(extension->name()) == title_tf_->text()) | 269 if (extension && base::UTF8ToUTF16(extension->name()) == title_tf_->text()) |
267 return; | 270 return; |
268 | 271 |
269 // Reinstall the app with an updated name. | 272 // Reinstall the app with an updated name. |
270 WebApplicationInfo install_info(web_app_info_); | 273 WebApplicationInfo install_info(web_app_info_); |
271 install_info.title = title_tf_->text(); | 274 install_info.title = title_tf_->text(); |
272 | 275 |
273 extensions::CreateOrUpdateBookmarkApp(GetExtensionService(profile_), | 276 extensions::CreateOrUpdateBookmarkApp(GetExtensionService(profile_), |
274 install_info); | 277 install_info); |
275 } | 278 } |
OLD | NEW |