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 <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 if (!image_result.image.IsEmpty()) { | 770 if (!image_result.image.IsEmpty()) { |
771 WebApplicationInfo::IconInfo icon; | 771 WebApplicationInfo::IconInfo icon; |
772 icon.data = image_result.image.AsBitmap(); | 772 icon.data = image_result.image.AsBitmap(); |
773 icon.width = icon.data.width(); | 773 icon.width = icon.data.width(); |
774 icon.height = icon.data.height(); | 774 icon.height = icon.data.height(); |
775 web_app->icons.push_back(icon); | 775 web_app->icons.push_back(icon); |
776 } | 776 } |
777 | 777 |
778 scoped_refptr<CrxInstaller> installer( | 778 scoped_refptr<CrxInstaller> installer( |
779 CrxInstaller::Create(extension_service_, NULL)); | 779 CrxInstaller::Create(extension_service_, NULL)); |
| 780 installer->set_error_on_unsupported_requirements(true); |
780 installer->set_page_ordinal(install_info->page_ordinal); | 781 installer->set_page_ordinal(install_info->page_ordinal); |
781 installer->InstallWebApp(*web_app); | 782 installer->InstallWebApp(*web_app); |
782 attempted_bookmark_app_install_ = true; | 783 attempted_bookmark_app_install_ = true; |
783 } | 784 } |
784 | 785 |
785 void AppLauncherHandler::SetAppToBeHighlighted() { | 786 void AppLauncherHandler::SetAppToBeHighlighted() { |
786 if (highlight_app_id_.empty()) | 787 if (highlight_app_id_.empty()) |
787 return; | 788 return; |
788 | 789 |
789 StringValue app_id(highlight_app_id_); | 790 StringValue app_id(highlight_app_id_); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
940 | 941 |
941 ExtensionInstallPrompt* AppLauncherHandler::GetExtensionInstallPrompt() { | 942 ExtensionInstallPrompt* AppLauncherHandler::GetExtensionInstallPrompt() { |
942 if (!extension_install_ui_.get()) { | 943 if (!extension_install_ui_.get()) { |
943 Browser* browser = browser::FindBrowserWithWebContents( | 944 Browser* browser = browser::FindBrowserWithWebContents( |
944 web_ui()->GetWebContents()); | 945 web_ui()->GetWebContents()); |
945 extension_install_ui_.reset( | 946 extension_install_ui_.reset( |
946 chrome::CreateExtensionInstallPromptWithBrowser(browser)); | 947 chrome::CreateExtensionInstallPromptWithBrowser(browser)); |
947 } | 948 } |
948 return extension_install_ui_.get(); | 949 return extension_install_ui_.get(); |
949 } | 950 } |
OLD | NEW |