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

Unified Diff: chrome/browser/first_run/try_chrome_dialog_view.cc

Issue 12321061: Pulling user experiment code from BrowserDistribution to a new class. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Reupload with --similarity=90 to prevent patch failure in try jobs. Created 7 years, 10 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/chrome_installer_util.gypi » ('j') | chrome/installer/setup/setup_main.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/first_run/try_chrome_dialog_view.cc
diff --git a/chrome/browser/first_run/try_chrome_dialog_view.cc b/chrome/browser/first_run/try_chrome_dialog_view.cc
index 7db3ee67e2926430fd93d5858f803bf75b4ad59e..220c85580e0f47a587743ca13f9d849a1bca4fd0 100644
--- a/chrome/browser/first_run/try_chrome_dialog_view.cc
+++ b/chrome/browser/first_run/try_chrome_dialog_view.cc
@@ -10,7 +10,7 @@
#include "base/message_loop.h"
#include "base/string16.h"
#include "chrome/browser/process_singleton.h"
-#include "chrome/installer/util/browser_distribution.h"
+#include "chrome/installer/util/user_experiment.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
@@ -79,6 +79,8 @@ TryChromeDialogView::~TryChromeDialogView() {
TryChromeDialogView::Result TryChromeDialogView::ShowModal(
ProcessSingleton* process_singleton) {
+ using installer::UserExperiment;
+
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
views::ImageView* icon = new views::ImageView();
@@ -174,13 +176,8 @@ TryChromeDialogView::Result TryChromeDialogView::ShowModal(
layout->AddView(icon);
// Find out what experiment we are conducting.
- BrowserDistribution* dist = BrowserDistribution::GetDistribution();
- if (!dist) {
- NOTREACHED() << "Cannot determine browser distribution";
- return DIALOG_ERROR;
- }
- BrowserDistribution::UserExperiment experiment;
- if (!dist->GetExperimentDetails(&experiment, flavor_) ||
+ UserExperiment::ExperimentDetails experiment;
+ if (!UserExperiment::CreateExperimentDetails(&experiment, flavor_) ||
!experiment.heading) {
NOTREACHED() << "Cannot determine which headline to show.";
return DIALOG_ERROR;
@@ -214,7 +211,7 @@ TryChromeDialogView::Result TryChromeDialogView::ShowModal(
// Decide if the don't bug me is a button or a radio button.
bool dont_bug_me_button =
- ((experiment.flags & BrowserDistribution::kDontBugMeAsButton) != 0);
+ ((experiment.flags & UserExperiment::kDontBugMeAsButton) != 0);
// Optional third and fourth row.
if (!dont_bug_me_button) {
@@ -225,7 +222,7 @@ TryChromeDialogView::Result TryChromeDialogView::ShowModal(
dont_try_chrome_->set_listener(this);
layout->AddView(dont_try_chrome_);
}
- if (experiment.flags & BrowserDistribution::kUninstall) {
+ if (experiment.flags & UserExperiment::kUninstall) {
layout->StartRow(0, 2);
kill_chrome_ = new views::RadioButton(
l10n_util::GetStringUTF16(IDS_UNINSTALL_CHROME), kRadioGroupID);
@@ -237,7 +234,7 @@ TryChromeDialogView::Result TryChromeDialogView::ShowModal(
accept_button->set_tag(BT_OK_BUTTON);
views::Separator* separator = NULL;
- if (experiment.flags & BrowserDistribution::kMakeDefault) {
+ if (experiment.flags & UserExperiment::kMakeDefault) {
// In this flavor we have some veritical space, then a separator line
// and the 'make default' checkbox and the OK button on the same row.
layout->AddPaddingRow(0, views::kUnrelatedControlVerticalSpacing);
@@ -267,7 +264,7 @@ TryChromeDialogView::Result TryChromeDialogView::ShowModal(
}
}
- if (experiment.flags & BrowserDistribution::kWhyLink) {
+ if (experiment.flags & UserExperiment::kWhyLink) {
layout->StartRowWithPadding(0, 4, 0, 10);
views::Link* link = new views::Link(
l10n_util::GetStringUTF16(IDS_TRY_TOAST_WHY));
« no previous file with comments | « no previous file | chrome/chrome_installer_util.gypi » ('j') | chrome/installer/setup/setup_main.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698