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

Unified Diff: chrome/browser/web_applications/web_app_mac.mm

Issue 356893002: Add UMA for --app-shim-error. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/common/mac/app_mode_common.h » ('j') | tools/metrics/histograms/histograms.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/web_applications/web_app_mac.mm
diff --git a/chrome/browser/web_applications/web_app_mac.mm b/chrome/browser/web_applications/web_app_mac.mm
index 4acb374558c5de2c5f53fae632514450d677ebe7..baa35676ef4b79662aa9f34317aeda8cbd00c335 100644
--- a/chrome/browser/web_applications/web_app_mac.mm
+++ b/chrome/browser/web_applications/web_app_mac.mm
@@ -16,6 +16,7 @@
#include "base/mac/mac_util.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/mac/scoped_nsobject.h"
+#include "base/metrics/sparse_histogram.h"
#include "base/path_service.h"
#include "base/process/process_handle.h"
#include "base/strings/string16.h"
@@ -24,6 +25,7 @@
#include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/version.h"
#include "chrome/browser/browser_process.h"
#import "chrome/browser/mac/dock.h"
#include "chrome/browser/browser_process.h"
@@ -495,6 +497,19 @@ web_app::ShortcutInfo BuildShortcutInfoFromBundle(
return shortcut_info;
}
+web_app::ShortcutInfo RecordAppShimErrorAndBuildShortcutInfo(
+ const base::FilePath& bundle_path) {
+ NSDictionary* plist = ReadPlist(GetPlistPath(bundle_path));
+ base::Version full_version(base::SysNSStringToUTF8(
+ [plist valueForKey:app_mode::kCFBundleShortVersionStringKey]));
+ int major_version = 0;
+ if (full_version.IsValid())
+ major_version = full_version.components()[0];
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Apps.AppShimErrorVersion", major_version);
+
+ return BuildShortcutInfoFromBundle(bundle_path);
+}
+
void UpdateFileTypes(NSMutableDictionary* plist,
const extensions::FileHandlersInfo& file_handlers_info) {
NSMutableArray* document_types =
@@ -938,7 +953,7 @@ bool MaybeRebuildShortcut(const CommandLine& command_line) {
base::PostTaskAndReplyWithResult(
content::BrowserThread::GetBlockingPool(),
FROM_HERE,
- base::Bind(&BuildShortcutInfoFromBundle,
+ base::Bind(&RecordAppShimErrorAndBuildShortcutInfo,
command_line.GetSwitchValuePath(app_mode::kAppShimError)),
base::Bind(&RebuildAppAndLaunch));
return true;
« no previous file with comments | « no previous file | chrome/common/mac/app_mode_common.h » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698