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

Side by Side Diff: chrome/browser/ui/views/extensions/bookmark_app_bubble_view.cc

Issue 202523011: Add a function to create a bookmark app from a WebApplicationInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor_tab_helper
Patch Set: fix the fix Created 6 years, 8 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
« no previous file with comments | « chrome/browser/extensions/bookmark_app_helper_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/bookmark_app_helper_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698