OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #import "ios/chrome/browser/ui/activity_services/activity_type_util.h" | 5 #import "ios/chrome/browser/ui/activity_services/activity_type_util.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/user_metrics.h" | 8 #include "base/metrics/user_metrics.h" |
9 #include "base/metrics/user_metrics_action.h" | 9 #include "base/metrics/user_metrics_action.h" |
10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 bool IsPasswordManagerActivity(NSString* activity_string) { | 33 bool IsPasswordManagerActivity(NSString* activity_string) { |
34 static struct { | 34 static struct { |
35 const char* bundle_id; | 35 const char* bundle_id; |
36 bool exact_match; | 36 bool exact_match; |
37 } kAllPasswordManagerApps[] = { | 37 } kAllPasswordManagerApps[] = { |
38 // 1Password | 38 // 1Password |
39 {"com.agilebits.onepassword-ios.extension", true}, | 39 {"com.agilebits.onepassword-ios.extension", true}, |
40 // LastPass | 40 // LastPass |
41 {"com.lastpass.ilastpass.LastPassExt", true}, | 41 {"com.lastpass.ilastpass.LastPassExt", true}, |
42 // Dashlane | 42 // Dashlane |
43 {"com.dashlane.dashlanephonefinal.", false}}; | 43 {"com.dashlane.dashlanephonefinal.", false}, |
| 44 // Enpass |
| 45 {"in.sinew.Walletx.WalletxExt", true}}; |
44 | 46 |
45 std::string activity = base::SysNSStringToUTF8(activity_string); | 47 std::string activity = base::SysNSStringToUTF8(activity_string); |
46 for (const auto& app : kAllPasswordManagerApps) { | 48 for (const auto& app : kAllPasswordManagerApps) { |
47 std::string bundle_id(app.bundle_id); | 49 std::string bundle_id(app.bundle_id); |
48 if (app.exact_match) { | 50 if (app.exact_match) { |
49 if (activity == bundle_id) | 51 if (activity == bundle_id) |
50 return true; | 52 return true; |
51 } else { | 53 } else { |
52 if (activity.find(bundle_id) == 0) | 54 if (activity.find(bundle_id) == 0) |
53 return true; | 55 return true; |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 base::UserMetricsAction("MobileShareMenuToContentApp")); | 210 base::UserMetricsAction("MobileShareMenuToContentApp")); |
209 break; | 211 break; |
210 case APPEX_PASSWORD_MANAGEMENT: | 212 case APPEX_PASSWORD_MANAGEMENT: |
211 base::RecordAction( | 213 base::RecordAction( |
212 base::UserMetricsAction("MobileAppExFormFilledByPasswordManager")); | 214 base::UserMetricsAction("MobileAppExFormFilledByPasswordManager")); |
213 break; | 215 break; |
214 } | 216 } |
215 } | 217 } |
216 | 218 |
217 } // activity_type_util | 219 } // activity_type_util |
OLD | NEW |