| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 #include "extensions/browser/management_policy.h" | 53 #include "extensions/browser/management_policy.h" |
| 54 #include "extensions/browser/pref_names.h" | 54 #include "extensions/browser/pref_names.h" |
| 55 #include "extensions/common/constants.h" | 55 #include "extensions/common/constants.h" |
| 56 #include "extensions/common/extension.h" | 56 #include "extensions/common/extension.h" |
| 57 #include "extensions/common/extension_icon_set.h" | 57 #include "extensions/common/extension_icon_set.h" |
| 58 #include "extensions/common/extension_set.h" | 58 #include "extensions/common/extension_set.h" |
| 59 #include "grit/browser_resources.h" | 59 #include "grit/browser_resources.h" |
| 60 #include "grit/generated_resources.h" | 60 #include "grit/generated_resources.h" |
| 61 #include "ui/base/l10n/l10n_util.h" | 61 #include "ui/base/l10n/l10n_util.h" |
| 62 #include "ui/base/webui/web_ui_util.h" | 62 #include "ui/base/webui/web_ui_util.h" |
| 63 #include "ui/gfx/favicon_size.h" | |
| 64 #include "url/gurl.h" | 63 #include "url/gurl.h" |
| 65 | 64 |
| 66 using content::WebContents; | 65 using content::WebContents; |
| 67 using extensions::AppSorting; | 66 using extensions::AppSorting; |
| 68 using extensions::CrxInstaller; | 67 using extensions::CrxInstaller; |
| 69 using extensions::Extension; | 68 using extensions::Extension; |
| 70 using extensions::ExtensionPrefs; | 69 using extensions::ExtensionPrefs; |
| 71 using extensions::ExtensionRegistry; | 70 using extensions::ExtensionRegistry; |
| 72 using extensions::ExtensionSet; | 71 using extensions::ExtensionSet; |
| 73 using extensions::UnloadedExtensionInfo; | 72 using extensions::UnloadedExtensionInfo; |
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 LOG(ERROR) << "No favicon service"; | 693 LOG(ERROR) << "No favicon service"; |
| 695 return; | 694 return; |
| 696 } | 695 } |
| 697 | 696 |
| 698 scoped_ptr<AppInstallInfo> install_info(new AppInstallInfo()); | 697 scoped_ptr<AppInstallInfo> install_info(new AppInstallInfo()); |
| 699 install_info->title = title; | 698 install_info->title = title; |
| 700 install_info->app_url = launch_url; | 699 install_info->app_url = launch_url; |
| 701 install_info->page_ordinal = page_ordinal; | 700 install_info->page_ordinal = page_ordinal; |
| 702 | 701 |
| 703 favicon_service->GetFaviconImageForPageURL( | 702 favicon_service->GetFaviconImageForPageURL( |
| 704 FaviconService::FaviconForPageURLParams( | 703 launch_url, |
| 705 launch_url, favicon_base::FAVICON, gfx::kFaviconSize), | |
| 706 base::Bind(&AppLauncherHandler::OnFaviconForApp, | 704 base::Bind(&AppLauncherHandler::OnFaviconForApp, |
| 707 base::Unretained(this), | 705 base::Unretained(this), |
| 708 base::Passed(&install_info)), | 706 base::Passed(&install_info)), |
| 709 &cancelable_task_tracker_); | 707 &cancelable_task_tracker_); |
| 710 } | 708 } |
| 711 | 709 |
| 712 void AppLauncherHandler::StopShowingAppLauncherPromo( | 710 void AppLauncherHandler::StopShowingAppLauncherPromo( |
| 713 const base::ListValue* args) { | 711 const base::ListValue* args) { |
| 714 #if defined(ENABLE_APP_LIST) | 712 #if defined(ENABLE_APP_LIST) |
| 715 g_browser_process->local_state()->SetBoolean( | 713 g_browser_process->local_state()->SetBoolean( |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 AppLauncherHandler::GetExtensionUninstallDialog() { | 836 AppLauncherHandler::GetExtensionUninstallDialog() { |
| 839 if (!extension_uninstall_dialog_.get()) { | 837 if (!extension_uninstall_dialog_.get()) { |
| 840 Browser* browser = chrome::FindBrowserWithWebContents( | 838 Browser* browser = chrome::FindBrowserWithWebContents( |
| 841 web_ui()->GetWebContents()); | 839 web_ui()->GetWebContents()); |
| 842 extension_uninstall_dialog_.reset( | 840 extension_uninstall_dialog_.reset( |
| 843 extensions::ExtensionUninstallDialog::Create( | 841 extensions::ExtensionUninstallDialog::Create( |
| 844 extension_service_->profile(), browser, this)); | 842 extension_service_->profile(), browser, this)); |
| 845 } | 843 } |
| 846 return extension_uninstall_dialog_.get(); | 844 return extension_uninstall_dialog_.get(); |
| 847 } | 845 } |
| OLD | NEW |