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

Side by Side Diff: chrome/browser/ui/webui/sync_promo/sync_promo_trial.cc

Issue 18603006: Bookmark sync promo for Views. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test for CrOS Created 7 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/sync_promo/sync_promo_trial.h" 5 #include "chrome/browser/ui/webui/sync_promo/sync_promo_trial.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/metrics/metrics_service.h" 8 #include "chrome/browser/metrics/metrics_service.h"
9 #include "chrome/browser/ui/sync/sync_promo_ui.h" 9 #include "chrome/browser/ui/sync/sync_promo_ui.h"
10 #include "content/public/browser/web_contents.h" 10 #include "content/public/browser/web_contents.h"
(...skipping 13 matching lines...) Expand all
24 UMA_EXTENSION_INSTALL_BUBBLE_SHOWN, 24 UMA_EXTENSION_INSTALL_BUBBLE_SHOWN,
25 UMA_EXTENSION_INSTALL_BUBBLE_SIGNED_IN, 25 UMA_EXTENSION_INSTALL_BUBBLE_SIGNED_IN,
26 UMA_UNKNOWN_SHOWN, 26 UMA_UNKNOWN_SHOWN,
27 UMA_UNKNOWN_SIGNED_IN, 27 UMA_UNKNOWN_SIGNED_IN,
28 UMA_WEBSTORE_INSTALL_SHOWN, 28 UMA_WEBSTORE_INSTALL_SHOWN,
29 UMA_WEBSTORE_INSTALL_SIGNED_IN, 29 UMA_WEBSTORE_INSTALL_SIGNED_IN,
30 UMA_APP_LAUNCHER_SHOWN, 30 UMA_APP_LAUNCHER_SHOWN,
31 UMA_APP_LAUNCHER_SIGNED_IN, 31 UMA_APP_LAUNCHER_SIGNED_IN,
32 UMA_APPS_PAGE_LINK_SHOWN, 32 UMA_APPS_PAGE_LINK_SHOWN,
33 UMA_APPS_PAGE_LINK_SIGNED_IN, 33 UMA_APPS_PAGE_LINK_SIGNED_IN,
34 UMA_BOOKMARK_BUBBLE_SHOWN,
35 UMA_BOOKMARK_BUBBLE_SIGNED_IN,
34 UMA_MAX, 36 UMA_MAX,
35 }; 37 };
36 38
37 } // namespace 39 } // namespace
38 40
39 namespace sync_promo_trial { 41 namespace sync_promo_trial {
40 42
41 void RecordUserShownPromo(content::WebUI* web_ui) { 43 void RecordUserShownPromo(content::WebUI* web_ui) {
42 SyncPromoUI::Source source = SyncPromoUI::GetSourceForSyncPromoURL( 44 SyncPromoUI::Source source = SyncPromoUI::GetSourceForSyncPromoURL(
43 web_ui->GetWebContents()->GetURL()); 45 web_ui->GetWebContents()->GetURL());
(...skipping 16 matching lines...) Expand all
60 break; 62 break;
61 case SyncPromoUI::SOURCE_WEBSTORE_INSTALL: 63 case SyncPromoUI::SOURCE_WEBSTORE_INSTALL:
62 uma = UMA_WEBSTORE_INSTALL_SHOWN; 64 uma = UMA_WEBSTORE_INSTALL_SHOWN;
63 break; 65 break;
64 case SyncPromoUI::SOURCE_APP_LAUNCHER: 66 case SyncPromoUI::SOURCE_APP_LAUNCHER:
65 uma = UMA_APP_LAUNCHER_SHOWN; 67 uma = UMA_APP_LAUNCHER_SHOWN;
66 break; 68 break;
67 case SyncPromoUI::SOURCE_APPS_PAGE_LINK: 69 case SyncPromoUI::SOURCE_APPS_PAGE_LINK:
68 uma = UMA_APPS_PAGE_LINK_SHOWN; 70 uma = UMA_APPS_PAGE_LINK_SHOWN;
69 break; 71 break;
72 case SyncPromoUI::SOURCE_BOOKMARK_BUBBLE:
73 uma = UMA_BOOKMARK_BUBBLE_SHOWN;
74 break;
70 case SyncPromoUI::SOURCE_UNKNOWN: 75 case SyncPromoUI::SOURCE_UNKNOWN:
71 uma = UMA_UNKNOWN_SHOWN; 76 uma = UMA_UNKNOWN_SHOWN;
72 break; 77 break;
73 default: 78 default:
74 // If this assert hits, then the SyncPromoUI::Source enum has changed and 79 // If this assert hits, then the SyncPromoUI::Source enum has changed and
75 // the UMA enum above, this switch statement and histograms.xml all need 80 // the UMA enum above, this switch statement and histograms.xml all need
76 // to be updated to reflect that. 81 // to be updated to reflect that.
77 COMPILE_ASSERT(SyncPromoUI::SOURCE_UNKNOWN == 8, 82 COMPILE_ASSERT(SyncPromoUI::SOURCE_UNKNOWN == 9,
78 kSourceEnumHasChangedButNotThisSwitchStatement); 83 kSourceEnumHasChangedButNotThisSwitchStatement);
79 NOTREACHED(); 84 NOTREACHED();
80 break; 85 break;
81 } 86 }
82 UMA_HISTOGRAM_ENUMERATION("SyncPromo.ShowAndSignIn", uma, UMA_MAX); 87 UMA_HISTOGRAM_ENUMERATION("SyncPromo.ShowAndSignIn", uma, UMA_MAX);
83 } 88 }
84 89
85 void RecordUserSignedIn(content::WebUI* web_ui) { 90 void RecordUserSignedIn(content::WebUI* web_ui) {
86 SyncPromoUI::Source source = SyncPromoUI::GetSourceForSyncPromoURL( 91 SyncPromoUI::Source source = SyncPromoUI::GetSourceForSyncPromoURL(
87 web_ui->GetWebContents()->GetURL()); 92 web_ui->GetWebContents()->GetURL());
(...skipping 16 matching lines...) Expand all
104 break; 109 break;
105 case SyncPromoUI::SOURCE_WEBSTORE_INSTALL: 110 case SyncPromoUI::SOURCE_WEBSTORE_INSTALL:
106 uma = UMA_WEBSTORE_INSTALL_SIGNED_IN; 111 uma = UMA_WEBSTORE_INSTALL_SIGNED_IN;
107 break; 112 break;
108 case SyncPromoUI::SOURCE_APP_LAUNCHER: 113 case SyncPromoUI::SOURCE_APP_LAUNCHER:
109 uma = UMA_APP_LAUNCHER_SIGNED_IN; 114 uma = UMA_APP_LAUNCHER_SIGNED_IN;
110 break; 115 break;
111 case SyncPromoUI::SOURCE_APPS_PAGE_LINK: 116 case SyncPromoUI::SOURCE_APPS_PAGE_LINK:
112 uma = UMA_APPS_PAGE_LINK_SIGNED_IN; 117 uma = UMA_APPS_PAGE_LINK_SIGNED_IN;
113 break; 118 break;
119 case SyncPromoUI::SOURCE_BOOKMARK_BUBBLE:
120 uma = UMA_BOOKMARK_BUBBLE_SIGNED_IN;
121 break;
114 case SyncPromoUI::SOURCE_UNKNOWN: 122 case SyncPromoUI::SOURCE_UNKNOWN:
115 uma = UMA_UNKNOWN_SIGNED_IN; 123 uma = UMA_UNKNOWN_SIGNED_IN;
116 break; 124 break;
117 default: 125 default:
118 // This switch statement needs to be updated when the enum Source changes. 126 // This switch statement needs to be updated when the enum Source changes.
119 COMPILE_ASSERT(SyncPromoUI::SOURCE_UNKNOWN == 8, 127 COMPILE_ASSERT(SyncPromoUI::SOURCE_UNKNOWN == 9,
120 kSourceEnumHasChangedButNotThisSwitchStatement); 128 kSourceEnumHasChangedButNotThisSwitchStatement);
121 NOTREACHED(); 129 NOTREACHED();
122 break; 130 break;
123 } 131 }
124 UMA_HISTOGRAM_ENUMERATION("SyncPromo.ShowAndSignIn", uma, UMA_MAX); 132 UMA_HISTOGRAM_ENUMERATION("SyncPromo.ShowAndSignIn", uma, UMA_MAX);
125 } 133 }
126 134
127 } // namespace sync_promo_trial 135 } // namespace sync_promo_trial
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698