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

Side by Side Diff: chrome/browser/ui/webui/ntp/app_launcher_handler.cc

Issue 15715003: Make app launcher Chrome Store UMA consistent with NTP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: bs Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
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/pref_names.h" 9 #include "apps/pref_names.h"
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 if (app_type == extensions::Manifest::TYPE_PLATFORM_APP) { 748 if (app_type == extensions::Manifest::TYPE_PLATFORM_APP) {
749 UMA_HISTOGRAM_ENUMERATION(extension_misc::kPlatformAppLaunchHistogram, 749 UMA_HISTOGRAM_ENUMERATION(extension_misc::kPlatformAppLaunchHistogram,
750 bucket, extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); 750 bucket, extension_misc::APP_LAUNCH_BUCKET_BOUNDARY);
751 } else { 751 } else {
752 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, 752 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram,
753 bucket, extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); 753 bucket, extension_misc::APP_LAUNCH_BUCKET_BOUNDARY);
754 } 754 }
755 } 755 }
756 756
757 // static 757 // static
758 void AppLauncherHandler::RecordAppListSearchLaunch(const Extension* extension) {
759 extension_misc::AppLaunchBucket bucket =
760 extension_misc::APP_LAUNCH_APP_LIST_SEARCH;
761 if (extension->id() == extension_misc::kWebStoreAppId)
762 bucket = extension_misc::APP_LAUNCH_APP_LIST_SEARCH_WEBSTORE;
763 else if (extension->id() == extension_misc::kChromeAppId)
764 bucket = extension_misc::APP_LAUNCH_APP_LIST_SEARCH_CHROME;
765 AppLauncherHandler::RecordAppLaunchType(bucket, extension->GetType());
766 }
767
768 // static
769 void AppLauncherHandler::RecordAppListMainLaunch(const Extension* extension) {
770 extension_misc::AppLaunchBucket bucket =
771 extension_misc::APP_LAUNCH_APP_LIST_MAIN;
772 if (extension->id() == extension_misc::kWebStoreAppId)
773 bucket = extension_misc::APP_LAUNCH_APP_LIST_MAIN_WEBSTORE;
774 else if (extension->id() == extension_misc::kChromeAppId)
775 bucket = extension_misc::APP_LAUNCH_APP_LIST_MAIN_CHROME;
776 AppLauncherHandler::RecordAppLaunchType(bucket, extension->GetType());
777 }
778
779 // static
758 void AppLauncherHandler::RecordWebStoreLaunch() { 780 void AppLauncherHandler::RecordWebStoreLaunch() {
759 RecordAppLaunchType(extension_misc::APP_LAUNCH_NTP_WEBSTORE, 781 RecordAppLaunchType(extension_misc::APP_LAUNCH_NTP_WEBSTORE,
760 extensions::Manifest::TYPE_HOSTED_APP); 782 extensions::Manifest::TYPE_HOSTED_APP);
761 } 783 }
762 784
763 // static 785 // static
764 void AppLauncherHandler::RecordAppLaunchByUrl( 786 void AppLauncherHandler::RecordAppLaunchByUrl(
765 Profile* profile, 787 Profile* profile,
766 std::string escaped_url, 788 std::string escaped_url,
767 extension_misc::AppLaunchBucket bucket) { 789 extension_misc::AppLaunchBucket bucket) {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() { 861 ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() {
840 if (!extension_uninstall_dialog_.get()) { 862 if (!extension_uninstall_dialog_.get()) {
841 Browser* browser = chrome::FindBrowserWithWebContents( 863 Browser* browser = chrome::FindBrowserWithWebContents(
842 web_ui()->GetWebContents()); 864 web_ui()->GetWebContents());
843 extension_uninstall_dialog_.reset( 865 extension_uninstall_dialog_.reset(
844 ExtensionUninstallDialog::Create(extension_service_->profile(), 866 ExtensionUninstallDialog::Create(extension_service_->profile(),
845 browser, this)); 867 browser, this));
846 } 868 }
847 return extension_uninstall_dialog_.get(); 869 return extension_uninstall_dialog_.get();
848 } 870 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/app_launcher_handler.h ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698