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/webui/ntp/app_launcher_handler.h" | 5 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "apps/metrics_names.h" | 9 #include "apps/metrics_names.h" |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 if (!image_result.image.IsEmpty()) { | 732 if (!image_result.image.IsEmpty()) { |
733 WebApplicationInfo::IconInfo icon; | 733 WebApplicationInfo::IconInfo icon; |
734 icon.data = image_result.image.AsBitmap(); | 734 icon.data = image_result.image.AsBitmap(); |
735 icon.width = icon.data.width(); | 735 icon.width = icon.data.width(); |
736 icon.height = icon.data.height(); | 736 icon.height = icon.data.height(); |
737 web_app->icons.push_back(icon); | 737 web_app->icons.push_back(icon); |
738 } | 738 } |
739 | 739 |
740 scoped_refptr<CrxInstaller> installer( | 740 scoped_refptr<CrxInstaller> installer( |
741 CrxInstaller::CreateSilent(extension_service_)); | 741 CrxInstaller::CreateSilent(extension_service_)); |
| 742 installer->set_creation_flags(Extension::FROM_BOOKMARK); |
742 installer->set_error_on_unsupported_requirements(true); | 743 installer->set_error_on_unsupported_requirements(true); |
743 installer->set_page_ordinal(install_info->page_ordinal); | 744 installer->set_page_ordinal(install_info->page_ordinal); |
744 installer->InstallWebApp(*web_app); | 745 installer->InstallWebApp(*web_app); |
745 attempted_bookmark_app_install_ = true; | 746 attempted_bookmark_app_install_ = true; |
746 } | 747 } |
747 | 748 |
748 void AppLauncherHandler::SetAppToBeHighlighted() { | 749 void AppLauncherHandler::SetAppToBeHighlighted() { |
749 if (highlight_app_id_.empty()) | 750 if (highlight_app_id_.empty()) |
750 return; | 751 return; |
751 | 752 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() { | 838 ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() { |
838 if (!extension_uninstall_dialog_.get()) { | 839 if (!extension_uninstall_dialog_.get()) { |
839 Browser* browser = chrome::FindBrowserWithWebContents( | 840 Browser* browser = chrome::FindBrowserWithWebContents( |
840 web_ui()->GetWebContents()); | 841 web_ui()->GetWebContents()); |
841 extension_uninstall_dialog_.reset( | 842 extension_uninstall_dialog_.reset( |
842 ExtensionUninstallDialog::Create(extension_service_->profile(), | 843 ExtensionUninstallDialog::Create(extension_service_->profile(), |
843 browser, this)); | 844 browser, this)); |
844 } | 845 } |
845 return extension_uninstall_dialog_.get(); | 846 return extension_uninstall_dialog_.get(); |
846 } | 847 } |
OLD | NEW |