| 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/crx_installer.h" | 10 #include "chrome/browser/extensions/bookmark_app_helper.h" |
| 11 #include "chrome/browser/extensions/extension_service.h" |
| 11 #include "chrome/browser/extensions/launch_util.h" | 12 #include "chrome/browser/extensions/launch_util.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 13 #include "extensions/browser/pref_names.h" | 14 #include "extensions/browser/pref_names.h" |
| 14 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
| 15 #include "grit/theme_resources.h" | 16 #include "grit/theme_resources.h" |
| 16 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
| 17 #include "ui/base/resource/resource_bundle.h" | 18 #include "ui/base/resource/resource_bundle.h" |
| 18 #include "ui/events/keycodes/keyboard_codes.h" | 19 #include "ui/events/keycodes/keyboard_codes.h" |
| 19 #include "ui/views/controls/button/checkbox.h" | 20 #include "ui/views/controls/button/checkbox.h" |
| 20 #include "ui/views/controls/button/label_button.h" | 21 #include "ui/views/controls/button/label_button.h" |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 | 251 |
| 251 const extensions::Extension* extension = | 252 const extensions::Extension* extension = |
| 252 profile_->GetExtensionService()->GetInstalledExtension(extension_id_); | 253 profile_->GetExtensionService()->GetInstalledExtension(extension_id_); |
| 253 if (extension && base::UTF8ToUTF16(extension->name()) == title_tf_->text()) | 254 if (extension && base::UTF8ToUTF16(extension->name()) == title_tf_->text()) |
| 254 return; | 255 return; |
| 255 | 256 |
| 256 // Reinstall the app with an updated name. | 257 // Reinstall the app with an updated name. |
| 257 WebApplicationInfo install_info(web_app_info_); | 258 WebApplicationInfo install_info(web_app_info_); |
| 258 install_info.title = title_tf_->text(); | 259 install_info.title = title_tf_->text(); |
| 259 | 260 |
| 260 scoped_refptr<extensions::CrxInstaller> installer( | 261 extensions::CreateOrUpdateBookmarkApp(profile_->GetExtensionService(), |
| 261 extensions::CrxInstaller::CreateSilent(profile_->GetExtensionService())); | 262 install_info); |
| 262 installer->set_error_on_unsupported_requirements(true); | |
| 263 installer->InstallWebApp(install_info); | |
| 264 } | 263 } |
| OLD | NEW |