summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormal@google.com <mal@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-23 19:04:45 +0000
committermal@google.com <mal@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-23 19:04:45 +0000
commit9eff5038e4a4958ff341354df447aca04d5aceb3 (patch)
tree480350560124b934fdb840be8adddceaa302ade6
parenta2c442f79e5cff1c95ec8493c125244ccb416683 (diff)
downloadchromium_src-9eff5038e4a4958ff341354df447aca04d5aceb3.zip
chromium_src-9eff5038e4a4958ff341354df447aca04d5aceb3.tar.gz
chromium_src-9eff5038e4a4958ff341354df447aca04d5aceb3.tar.bz2
Prepare for re-activation toast on 963.
This doesn't enable the toast, but sets up everything so that all we have to do is flip false to true later. All the possible actions, including uninstall, have been tested locally. This _can_ be tested with brand code CHXX. BUG=107770 Review URL: https://chromiumcodereview.appspot.com/9141032 git-svn-id: svn://svn.chromium.org/chrome/branches/963/src@118708 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chrome_browser_main.cc5
-rw-r--r--chrome/browser/chrome_browser_main.h4
-rw-r--r--chrome/common/attrition_experiments.h5
-rw-r--r--chrome/installer/util/google_chrome_distribution.cc15
-rw-r--r--content/browser/browser_main_loop.cc7
-rw-r--r--content/public/browser/browser_main_parts.h7
-rw-r--r--content/shell/shell_browser_main.cc6
-rw-r--r--content/shell/shell_browser_main.h4
8 files changed, 32 insertions, 21 deletions
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 068e195..16b8014 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -1209,8 +1209,9 @@ void ChromeBrowserMainParts::PostMainMessageLoopStart() {
chrome_extra_parts_[i]->PostMainMessageLoopStart();
}
-void ChromeBrowserMainParts::PreCreateThreads() {
+int ChromeBrowserMainParts::PreCreateThreads() {
result_code_ = PreCreateThreadsImpl();
+ return result_code_;
}
int ChromeBrowserMainParts::PreCreateThreadsImpl() {
diff --git a/chrome/browser/chrome_browser_main.h b/chrome/browser/chrome_browser_main.h
index 26f22a6..1bd381a 100644
--- a/chrome/browser/chrome_browser_main.h
+++ b/chrome/browser/chrome_browser_main.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -61,7 +61,7 @@ class ChromeBrowserMainParts : public content::BrowserMainParts {
virtual void ToolkitInitialized() OVERRIDE;
virtual void PreMainMessageLoopStart() OVERRIDE;
virtual void PostMainMessageLoopStart() OVERRIDE;
- virtual void PreCreateThreads() OVERRIDE;
+ virtual int PreCreateThreads() OVERRIDE;
virtual void PreStartThread(content::BrowserThread::ID identifier) OVERRIDE;
virtual void PostStartThread(content::BrowserThread::ID identifier) OVERRIDE;
virtual void PreMainMessageLoopRun() OVERRIDE;
diff --git a/chrome/common/attrition_experiments.h b/chrome/common/attrition_experiments.h
index 5e47463..c5d7d45 100644
--- a/chrome/common/attrition_experiments.h
+++ b/chrome/common/attrition_experiments.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -26,6 +26,9 @@ const wchar_t kAll[] = L"*";
// A comma-separated list of brand codes that are associated with Skype.
const wchar_t kSkype[] = L"SKPC,SKPG,SKPH,SKPI,SKPL,SKPM,SKPN";
+// The brand code for enterprise installations.
+const wchar_t kEnterprise[] = L"GGRV";
+
// Constants for the "infobar plugins" experiment. These strings become
// the registry omaha |client| value. The last one is considered to be
// the control group which reflects the current behavior. Note that
diff --git a/chrome/installer/util/google_chrome_distribution.cc b/chrome/installer/util/google_chrome_distribution.cc
index 7a0e89d..ca3c6b4 100644
--- a/chrome/installer/util/google_chrome_distribution.cc
+++ b/chrome/installer/util/google_chrome_distribution.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@@ -583,6 +583,7 @@ bool GoogleChromeDistribution::GetExperimentDetails(
// The big experiment in Apr 2010 used TMxx and TNxx.
// The big experiment in Oct 2010 used TVxx TWxx TXxx TYxx.
// The big experiment in Feb 2011 used SJxx SKxx SLxx SMxx.
+ // The Chrome 17 toast in Q1 2012 used BAxx.
// Note: the plugin infobar experiment uses PIxx codes.
using namespace attrition_experiments;
static const struct UserExperimentDetails {
@@ -598,12 +599,8 @@ bool GoogleChromeDistribution::GetExperimentDetails(
// of headings (below).
int headings[kMax]; // A list of IDs per experiment. 0 == no heading.
} kExperimentFlavors[] = {
- // First in this order are the brand specific ones.
- {L"en-US", kSkype, 1, L'Z', L'A', 1, { kSkype1, 0, 0, 0 } },
- // And then we have catch-alls, like en-US (all brands).
- {L"en-US", kAll, 1, L'T', L'V', 4, { kEnUs1, kEnUs2, kEnUs3, kEnUs4} },
- // Japan has two experiments, same IDs as en-US but translated differently.
- {L"jp", kAll, 1, L'T', L'V', 2, { kEnUs1, kEnUs2, 0, 0} },
+ // Give all locales and brand codes the "new, safer Chrome" message.
+ {kAll, kAll, 1, L'B', L'A', 1, {kEnUs3, 0, 0, 0} },
};
std::wstring locale;
@@ -612,6 +609,8 @@ bool GoogleChromeDistribution::GetExperimentDetails(
if (!GoogleUpdateSettings::GetLanguage(&locale))
locale = L"en-US";
if (!GoogleUpdateSettings::GetBrand(&brand))
+ brand = ASCIIToWide(""); // Could still be viable for catch-all rules.
+ if (brand == kEnterprise)
return false;
for (int i = 0; i < arraysize(kExperimentFlavors); ++i) {
@@ -631,7 +630,7 @@ bool GoogleChromeDistribution::GetExperimentDetails(
kExperimentFlavors[i].flavors - 1 <= 'Z');
if (kExperimentFlavors[i].locale != locale &&
- kExperimentFlavors[i].locale != L"*")
+ kExperimentFlavors[i].locale != ASCIIToWide("*"))
continue;
std::vector<std::wstring> brand_codes;
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index 1e0808c..f29805c 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -295,7 +295,10 @@ void BrowserMainLoop::MainMessageLoopStart() {
void BrowserMainLoop::RunMainMessageLoopParts(
bool* completed_main_message_loop) {
if (parts_.get())
- parts_->PreCreateThreads();
+ result_code_ = parts_->PreCreateThreads();
+
+ if (result_code_ > 0)
+ return;
base::Thread::Options default_options;
base::Thread::Options io_message_loop_options;
diff --git a/content/public/browser/browser_main_parts.h b/content/public/browser/browser_main_parts.h
index 4bce3cf..9c1df45 100644
--- a/content/public/browser/browser_main_parts.h
+++ b/content/public/browser/browser_main_parts.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -69,8 +69,9 @@ class CONTENT_EXPORT BrowserMainParts {
// framework are created.
//
// The main message loop has been started at this point (but has not
- // been run), and the toolkit has been initialized.
- virtual void PreCreateThreads() = 0;
+ // been run), and the toolkit has been initialized. Returns the error code
+ // (or 0 if no error).
+ virtual int PreCreateThreads() = 0;
// Called once for each thread owned by the content framework just
// before and just after the thread object is created and started.
diff --git a/content/shell/shell_browser_main.cc b/content/shell/shell_browser_main.cc
index 6b14d0f..b122cc6 100644
--- a/content/shell/shell_browser_main.cc
+++ b/content/shell/shell_browser_main.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -43,6 +43,10 @@ ShellBrowserMainParts::ShellBrowserMainParts(
ShellBrowserMainParts::~ShellBrowserMainParts() {
}
+int ShellBrowserMainParts::PreCreateThreads() {
+ return 0;
+}
+
void ShellBrowserMainParts::PreMainMessageLoopRun() {
browser_context_.reset(new ShellBrowserContext(this));
diff --git a/content/shell/shell_browser_main.h b/content/shell/shell_browser_main.h
index e842e21..b8e1b9d 100644
--- a/content/shell/shell_browser_main.h
+++ b/content/shell/shell_browser_main.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -35,7 +35,7 @@ class ShellBrowserMainParts : public BrowserMainParts {
virtual void PreMainMessageLoopStart() OVERRIDE {}
virtual void ToolkitInitialized() OVERRIDE {}
virtual void PostMainMessageLoopStart() OVERRIDE {}
- virtual void PreCreateThreads() OVERRIDE {}
+ virtual int PreCreateThreads() OVERRIDE;
virtual void PreStartThread(BrowserThread::ID id) OVERRIDE {}
virtual void PostStartThread(BrowserThread::ID id) OVERRIDE {}
virtual void PreMainMessageLoopRun() OVERRIDE;