| 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 17 matching lines...) Expand all Loading... |
| 28 #include "chrome/browser/ui/app_list/app_list_util.h" | 28 #include "chrome/browser/ui/app_list/app_list_util.h" |
| 29 #include "chrome/browser/ui/browser_dialogs.h" | 29 #include "chrome/browser/ui/browser_dialogs.h" |
| 30 #include "chrome/browser/ui/browser_finder.h" | 30 #include "chrome/browser/ui/browser_finder.h" |
| 31 #include "chrome/browser/ui/browser_tabstrip.h" | 31 #include "chrome/browser/ui/browser_tabstrip.h" |
| 32 #include "chrome/browser/ui/browser_window.h" | 32 #include "chrome/browser/ui/browser_window.h" |
| 33 #include "chrome/browser/ui/extensions/application_launch.h" | 33 #include "chrome/browser/ui/extensions/application_launch.h" |
| 34 #include "chrome/browser/ui/extensions/extension_enable_flow.h" | 34 #include "chrome/browser/ui/extensions/extension_enable_flow.h" |
| 35 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 35 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 36 #include "chrome/browser/ui/webui/extensions/extension_basic_info.h" | 36 #include "chrome/browser/ui/webui/extensions/extension_basic_info.h" |
| 37 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 37 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 38 #include "chrome/browser/ui/webui/ntp/core_app_launcher_handler.h" | |
| 39 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" | 38 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
| 40 #include "chrome/common/extensions/extension_constants.h" | 39 #include "chrome/common/extensions/extension_constants.h" |
| 40 #include "chrome/common/extensions/extension_metrics.h" |
| 41 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" | 41 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" |
| 42 #include "chrome/common/pref_names.h" | 42 #include "chrome/common/pref_names.h" |
| 43 #include "chrome/common/url_constants.h" | 43 #include "chrome/common/url_constants.h" |
| 44 #include "chrome/common/web_application_info.h" | 44 #include "chrome/common/web_application_info.h" |
| 45 #include "chrome/grit/generated_resources.h" | 45 #include "chrome/grit/generated_resources.h" |
| 46 #include "components/favicon_base/favicon_types.h" | 46 #include "components/favicon_base/favicon_types.h" |
| 47 #include "content/public/browser/notification_service.h" | 47 #include "content/public/browser/notification_service.h" |
| 48 #include "content/public/browser/web_ui.h" | 48 #include "content/public/browser/web_ui.h" |
| 49 #include "content/public/common/favicon_url.h" | 49 #include "content/public/common/favicon_url.h" |
| 50 #include "extensions/browser/app_sorting.h" | 50 #include "extensions/browser/app_sorting.h" |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 PromptToEnableApp(extension_id); | 504 PromptToEnableApp(extension_id); |
| 505 return; | 505 return; |
| 506 } | 506 } |
| 507 | 507 |
| 508 Profile* profile = extension_service_->profile(); | 508 Profile* profile = extension_service_->profile(); |
| 509 | 509 |
| 510 WindowOpenDisposition disposition = args->GetSize() > 3 ? | 510 WindowOpenDisposition disposition = args->GetSize() > 3 ? |
| 511 webui::GetDispositionFromClick(args, 3) : CURRENT_TAB; | 511 webui::GetDispositionFromClick(args, 3) : CURRENT_TAB; |
| 512 if (extension_id != extensions::kWebStoreAppId) { | 512 if (extension_id != extensions::kWebStoreAppId) { |
| 513 CHECK_NE(launch_bucket, extension_misc::APP_LAUNCH_BUCKET_INVALID); | 513 CHECK_NE(launch_bucket, extension_misc::APP_LAUNCH_BUCKET_INVALID); |
| 514 CoreAppLauncherHandler::RecordAppLaunchType(launch_bucket, | 514 extensions::RecordAppLaunchType(launch_bucket, extension->GetType()); |
| 515 extension->GetType()); | |
| 516 } else { | 515 } else { |
| 517 CoreAppLauncherHandler::RecordWebStoreLaunch(); | 516 extensions::RecordWebStoreLaunch(); |
| 518 } | 517 } |
| 519 | 518 |
| 520 if (disposition == NEW_FOREGROUND_TAB || disposition == NEW_BACKGROUND_TAB || | 519 if (disposition == NEW_FOREGROUND_TAB || disposition == NEW_BACKGROUND_TAB || |
| 521 disposition == NEW_WINDOW) { | 520 disposition == NEW_WINDOW) { |
| 522 // TODO(jamescook): Proper support for background tabs. | 521 // TODO(jamescook): Proper support for background tabs. |
| 523 AppLaunchParams params(profile, extension, | 522 AppLaunchParams params(profile, extension, |
| 524 disposition == NEW_WINDOW ? | 523 disposition == NEW_WINDOW ? |
| 525 extensions::LAUNCH_CONTAINER_WINDOW : | 524 extensions::LAUNCH_CONTAINER_WINDOW : |
| 526 extensions::LAUNCH_CONTAINER_TAB, | 525 extensions::LAUNCH_CONTAINER_TAB, |
| 527 disposition); | 526 disposition); |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 Browser* browser = chrome::FindBrowserWithWebContents( | 845 Browser* browser = chrome::FindBrowserWithWebContents( |
| 847 web_ui()->GetWebContents()); | 846 web_ui()->GetWebContents()); |
| 848 extension_uninstall_dialog_.reset( | 847 extension_uninstall_dialog_.reset( |
| 849 extensions::ExtensionUninstallDialog::Create( | 848 extensions::ExtensionUninstallDialog::Create( |
| 850 extension_service_->profile(), | 849 extension_service_->profile(), |
| 851 browser->window()->GetNativeWindow(), | 850 browser->window()->GetNativeWindow(), |
| 852 this)); | 851 this)); |
| 853 } | 852 } |
| 854 return extension_uninstall_dialog_.get(); | 853 return extension_uninstall_dialog_.get(); |
| 855 } | 854 } |
| OLD | NEW |