| 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/sync_promo/sync_promo_handler2.h" | 5 #include "chrome/browser/ui/webui/sync_promo/sync_promo_handler2.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 BrowserList::FindBrowserWithWebContents(web_ui()->GetWebContents()); | 202 BrowserList::FindBrowserWithWebContents(web_ui()->GetWebContents()); |
| 203 if (!browser || !browser->IsAttemptingToCloseBrowser()) { | 203 if (!browser || !browser->IsAttemptingToCloseBrowser()) { |
| 204 GURL url = SyncPromoUI::GetNextPageURLForSyncPromoURL( | 204 GURL url = SyncPromoUI::GetNextPageURLForSyncPromoURL( |
| 205 web_ui_->tab_contents()->GetURL()); | 205 web_ui_->tab_contents()->GetURL()); |
| 206 web_ui_->tab_contents()->OpenURL(url, GURL(), CURRENT_TAB, | 206 web_ui_->tab_contents()->OpenURL(url, GURL(), CURRENT_TAB, |
| 207 content::PAGE_TRANSITION_LINK); | 207 content::PAGE_TRANSITION_LINK); |
| 208 } | 208 } |
| 209 } | 209 } |
| 210 | 210 |
| 211 void SyncPromoHandler2::HandleInitializeSyncPromo(const base::ListValue* args) { | 211 void SyncPromoHandler2::HandleInitializeSyncPromo(const base::ListValue* args) { |
| 212 // TODO(sail): The version argument is going away, remove this. | |
| 213 base::FundamentalValue version(3); | |
| 214 web_ui_->CallJavascriptFunction("SyncSetupOverlay.showPromoVersion", | |
| 215 version); | |
| 216 | |
| 217 OpenSyncSetup(); | 212 OpenSyncSetup(); |
| 218 // We don't need to compute anything for this, just do this every time. | 213 // We don't need to compute anything for this, just do this every time. |
| 219 RecordUserFlowAction(SYNC_PROMO_VIEWED); | 214 RecordUserFlowAction(SYNC_PROMO_VIEWED); |
| 220 // Increment view count first and show natural numbers in stats rather than 0 | 215 // Increment view count first and show natural numbers in stats rather than 0 |
| 221 // based starting point (if it happened to be our first time showing this). | 216 // based starting point (if it happened to be our first time showing this). |
| 222 IncrementViewCountBy(1); | 217 IncrementViewCountBy(1); |
| 223 // Record +1 for every view. This is the only thing we record that's not part | 218 // Record +1 for every view. This is the only thing we record that's not part |
| 224 // of the user flow histogram. | 219 // of the user flow histogram. |
| 225 UMA_HISTOGRAM_COUNTS("SyncPromo.NumTimesViewed", GetViewCount()); | 220 UMA_HISTOGRAM_COUNTS("SyncPromo.NumTimesViewed", GetViewCount()); |
| 226 } | 221 } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 // static variables that won't work if the name changes on differnt calls. | 285 // static variables that won't work if the name changes on differnt calls. |
| 291 if (!histogram_name_.empty()) { | 286 if (!histogram_name_.empty()) { |
| 292 base::Histogram* histogram = base::LinearHistogram::FactoryGet( | 287 base::Histogram* histogram = base::LinearHistogram::FactoryGet( |
| 293 histogram_name_, 1, SYNC_PROMO_BUCKET_BOUNDARY, | 288 histogram_name_, 1, SYNC_PROMO_BUCKET_BOUNDARY, |
| 294 SYNC_PROMO_BUCKET_BOUNDARY + 1, base::Histogram::kNoFlags); | 289 SYNC_PROMO_BUCKET_BOUNDARY + 1, base::Histogram::kNoFlags); |
| 295 histogram->Add(action); | 290 histogram->Add(action); |
| 296 } | 291 } |
| 297 } | 292 } |
| 298 | 293 |
| 299 } // namespace options2 | 294 } // namespace options2 |
| OLD | NEW |