summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-25 19:39:35 +0000
committerrogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-25 19:39:35 +0000
commitdcec41d5c9469ed4bc4b2fb7250cb3660e45ff38 (patch)
tree47a37f2b76e7796e3b405bf9f49fea386a816e1d
parente60f9306e6bc0e7faa6f628646f46ef40c719cd0 (diff)
downloadchromium_src-dcec41d5c9469ed4bc4b2fb7250cb3660e45ff38.zip
chromium_src-dcec41d5c9469ed4bc4b2fb7250cb3660e45ff38.tar.gz
chromium_src-dcec41d5c9469ed4bc4b2fb7250cb3660e45ff38.tar.bz2
Remove one-click signin inforbar, since its now replaced with the gaia
interstitial page. BUG=233003 Review URL: https://chromiumcodereview.appspot.com/14175017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196461 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/chromium_strings.grd3
-rw-r--r--chrome/app/generated_resources.grd7
-rw-r--r--chrome/app/google_chrome_strings.grd3
-rw-r--r--chrome/app/theme/default_100_percent/common/infobar_sync.pngbin430 -> 0 bytes
-rw-r--r--chrome/app/theme/default_100_percent/infobar_sync.pngbin430 -> 0 bytes
-rw-r--r--chrome/app/theme/default_200_percent/common/infobar_sync.pngbin836 -> 0 bytes
-rw-r--r--chrome/app/theme/default_200_percent/infobar_sync.pngbin836 -> 0 bytes
-rw-r--r--chrome/app/theme/theme_resources.grd1
-rw-r--r--chrome/app/theme/touch_100_percent/infobar_sync.pngbin559 -> 0 bytes
-rw-r--r--chrome/browser/automation/testing_automation_provider.cc3
-rw-r--r--chrome/browser/chrome_browser_field_trials_desktop.cc3
-rw-r--r--chrome/browser/infobars/infobar_delegate.h1
-rw-r--r--chrome/browser/ui/sync/one_click_signin_helper.cc200
-rw-r--r--chrome/browser/ui/sync/one_click_signin_helper.h3
-rw-r--r--chrome/browser/ui/sync/one_click_signin_infobar_delegate.cc18
-rw-r--r--chrome/browser/ui/sync/one_click_signin_infobar_delegate.h48
-rw-r--r--chrome/browser/ui/views/infobars/confirm_infobar.h8
-rw-r--r--chrome/browser/ui/views/infobars/infobar_background.cc7
-rw-r--r--chrome/browser/ui/views/infobars/infobar_background.h3
-rw-r--r--chrome/browser/ui/views/infobars/infobar_view.cc4
-rw-r--r--chrome/browser/ui/views/infobars/one_click_signin_infobar.cc146
-rw-r--r--chrome/browser/ui/views/infobars/one_click_signin_infobar.h32
-rw-r--r--chrome/browser/ui/views/infobars/translate_infobar_base.cc4
-rw-r--r--chrome/chrome_browser_ui.gypi8
24 files changed, 11 insertions, 491 deletions
diff --git a/chrome/app/chromium_strings.grd b/chrome/app/chromium_strings.grd
index 33d5e1e..605610f 100644
--- a/chrome/app/chromium_strings.grd
+++ b/chrome/app/chromium_strings.grd
@@ -849,9 +849,6 @@ For Chromium, processes used to display diagnostics information (such as this "a
<message name="IDS_ONE_CLICK_SIGNIN_DIALOG_TITLE" desc="The title of the modal dialog window that opens when the user chooses to use one click sign in.">
You're signed in to Chromium!
</message>
- <message name="IDS_ONE_CLICK_SIGNIN_INFOBAR_MESSAGE" desc="The string shown in the infobar explaining that the user can connect his profile to a Google account instead of logging in only here.">
- Use this Google Account to sync all your Chromium stuff?
- </message>
<message name="IDS_ONE_CLICK_SIGNIN_BUBBLE_MESSAGE" desc="The body of the sync promo NTP bubble.">
You're now signed in to Chromium! Your bookmarks, history, and other settings will be synced to your Google Account.
</message>
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index d18b545..1cf6539 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -11003,13 +11003,6 @@ experiment id: "<ph name="EXPERIMENT_ID">$5<ex>ar1</ex></ph>"
</message>
</if>
- <!-- One click sign in infobar -->
- <message name="IDS_ONE_CLICK_SIGNIN_INFOBAR_OK_BUTTON" desc="The string used in the infobar button that the user presses to accept one click sign in.">
- OK, sync
- </message>
- <message name="IDS_ONE_CLICK_SIGNIN_INFOBAR_CANCEL_BUTTON" desc="The string used in the infobar button that the user presses to never see this infobar again.">
- No thanks
- </message>
<message name="IDS_ONE_CLICK_SIGNIN_CONFIRM_EMAIL_DIALOG_OK_BUTTON" desc="The string used in the dialog for the button that means 'create a new profile'.">
Create a new user
</message>
diff --git a/chrome/app/google_chrome_strings.grd b/chrome/app/google_chrome_strings.grd
index e2af2166..422ed19 100644
--- a/chrome/app/google_chrome_strings.grd
+++ b/chrome/app/google_chrome_strings.grd
@@ -773,9 +773,6 @@ For Google Chrome, processes used to display diagnostics information (such as th
<message name="IDS_ONE_CLICK_SIGNIN_DIALOG_TITLE" desc="The title of the modal dialog window that opens when the user chooses to use one click sign in.">
You're signed in to Chrome!
</message>
- <message name="IDS_ONE_CLICK_SIGNIN_INFOBAR_MESSAGE" desc="The string shown in the infobar explaining that the user can connect his profile to a Google account instead of logging in only here.">
- Use this Google Account to sync all your Chrome stuff?
- </message>
<message name="IDS_ONE_CLICK_SIGNIN_BUBBLE_MESSAGE" desc="The body of the sync promo NTP bubble.">
You're now signed in to Chrome! Your bookmarks, history, and other settings will be synced to your Google Account.
</message>
diff --git a/chrome/app/theme/default_100_percent/common/infobar_sync.png b/chrome/app/theme/default_100_percent/common/infobar_sync.png
deleted file mode 100644
index 6af8f9f..0000000
--- a/chrome/app/theme/default_100_percent/common/infobar_sync.png
+++ /dev/null
Binary files differ
diff --git a/chrome/app/theme/default_100_percent/infobar_sync.png b/chrome/app/theme/default_100_percent/infobar_sync.png
deleted file mode 100644
index 6af8f9f..0000000
--- a/chrome/app/theme/default_100_percent/infobar_sync.png
+++ /dev/null
Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/infobar_sync.png b/chrome/app/theme/default_200_percent/common/infobar_sync.png
deleted file mode 100644
index efc4ccc..0000000
--- a/chrome/app/theme/default_200_percent/common/infobar_sync.png
+++ /dev/null
Binary files differ
diff --git a/chrome/app/theme/default_200_percent/infobar_sync.png b/chrome/app/theme/default_200_percent/infobar_sync.png
deleted file mode 100644
index efc4ccc..0000000
--- a/chrome/app/theme/default_200_percent/infobar_sync.png
+++ /dev/null
Binary files differ
diff --git a/chrome/app/theme/theme_resources.grd b/chrome/app/theme/theme_resources.grd
index ee7a986..85c099b 100644
--- a/chrome/app/theme/theme_resources.grd
+++ b/chrome/app/theme/theme_resources.grd
@@ -398,7 +398,6 @@
<structure type="chrome_scaled_image" name="IDR_INFOBAR_RESTORE_SESSION" file="infobar_restore.png" />
<structure type="chrome_scaled_image" name="IDR_INFOBAR_SAVE_PASSWORD" file="infobar_savepassword.png" />
<structure type="chrome_scaled_image" name="IDR_INFOBAR_SSL_WARNING" file="infobar_insecure.png" />
- <structure type="chrome_scaled_image" name="IDR_INFOBAR_SYNC" file="infobar_sync.png" />
<structure type="chrome_scaled_image" name="IDR_INFOBAR_THEME" file="infobar_theme.png" />
<structure type="chrome_scaled_image" name="IDR_INFOBAR_TRANSLATE" file="infobar_translate.png" />
<structure type="chrome_scaled_image" name="IDR_INPUT_ALERT" file="common/input_alert.png" />
diff --git a/chrome/app/theme/touch_100_percent/infobar_sync.png b/chrome/app/theme/touch_100_percent/infobar_sync.png
deleted file mode 100644
index 613aa25..0000000
--- a/chrome/app/theme/touch_100_percent/infobar_sync.png
+++ /dev/null
Binary files differ
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc
index f2330a5..869c504 100644
--- a/chrome/browser/automation/testing_automation_provider.cc
+++ b/chrome/browser/automation/testing_automation_provider.cc
@@ -2105,9 +2105,6 @@ ListValue* TestingAutomationProvider::GetInfobarsInfo(WebContents* wc) {
case InfoBarDelegate::CONFIRM_INFOBAR:
infobar_item->SetString("type", "confirm_infobar");
break;
- case InfoBarDelegate::ONE_CLICK_LOGIN_INFOBAR:
- infobar_item->SetString("type", "oneclicklogin_infobar");
- break;
case InfoBarDelegate::PASSWORD_INFOBAR:
infobar_item->SetString("type", "password_infobar");
break;
diff --git a/chrome/browser/chrome_browser_field_trials_desktop.cc b/chrome/browser/chrome_browser_field_trials_desktop.cc
index a94d0a0..90c882d 100644
--- a/chrome/browser/chrome_browser_field_trials_desktop.cc
+++ b/chrome/browser/chrome_browser_field_trials_desktop.cc
@@ -154,9 +154,6 @@ void SetupDesktopFieldTrials(const CommandLine& parsed_command_line,
SetUpCacheSensitivityAnalysisFieldTrial();
DisableShowProfileSwitcherTrialIfNecessary();
WindowsOverlappedTCPReadsFieldTrial(parsed_command_line);
-#if defined(ENABLE_ONE_CLICK_SIGNIN)
- OneClickSigninHelper::InitializeFieldTrial();
-#endif
SetupAppLauncherFieldTrial(local_state);
}
diff --git a/chrome/browser/infobars/infobar_delegate.h b/chrome/browser/infobars/infobar_delegate.h
index a7c0471..1fb7d63 100644
--- a/chrome/browser/infobars/infobar_delegate.h
+++ b/chrome/browser/infobars/infobar_delegate.h
@@ -42,7 +42,6 @@ class InfoBarDelegate {
enum InfoBarAutomationType {
CONFIRM_INFOBAR,
- ONE_CLICK_LOGIN_INFOBAR,
PASSWORD_INFOBAR,
RPH_INFOBAR,
UNKNOWN_INFOBAR,
diff --git a/chrome/browser/ui/sync/one_click_signin_helper.cc b/chrome/browser/ui/sync/one_click_signin_helper.cc
index 073dae6..3905e1d 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper.cc
@@ -42,7 +42,6 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/sync/one_click_signin_histogram.h"
-#include "chrome/browser/ui/sync/one_click_signin_infobar_delegate.h"
#include "chrome/browser/ui/sync/one_click_signin_sync_starter.h"
#include "chrome/browser/ui/sync/signin_histogram.h"
#include "chrome/browser/ui/tab_modal_confirm_dialog.h"
@@ -84,10 +83,6 @@ namespace {
// SAML-based accounts, but causes bug crbug.com/181163.
const int kMaxNavigationsSince = 10;
-// Set to true if this chrome instance is in the blue-button-on-white-bar
-// experimental group.
-bool use_blue_on_white = false;
-
// Add a specific email to the list of emails rejected for one-click
// sign-in, for this profile.
void AddEmailToOneClickRejectedList(Profile* profile,
@@ -444,178 +439,6 @@ void CurrentHistoryCleaner::WebContentsDestroyed(
} // namespace
-// The infobar asking the user if they want to use one-click sign in.
-// TODO(rogerta): once we move to a web-based sign in flow, we can get rid
-// of this infobar.
-class OneClickInfoBarDelegateImpl : public OneClickSigninInfoBarDelegate {
- public:
- // Creates a one click signin delegate and adds it to |infobar_service|.
- static void Create(InfoBarService* infobar_service,
- const std::string& session_index,
- const std::string& email,
- const std::string& password);
-
- private:
- OneClickInfoBarDelegateImpl(InfoBarService* owner,
- const std::string& session_index,
- const std::string& email,
- const std::string& password);
- virtual ~OneClickInfoBarDelegateImpl();
-
- // InfoBarDelegate overrides.
- virtual InfoBarAutomationType GetInfoBarAutomationType() const OVERRIDE;
- virtual void InfoBarDismissed() OVERRIDE;
- virtual gfx::Image* GetIcon() const OVERRIDE;
- virtual Type GetInfoBarType() const OVERRIDE;
- virtual string16 GetMessageText() const OVERRIDE;
-
- // ConfirmInfoBarDelegate overrides.
- virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
- virtual bool Accept() OVERRIDE;
- virtual bool Cancel() OVERRIDE;
- virtual string16 GetLinkText() const OVERRIDE;
- virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE;
-
- // OneClickSigninInfoBarDelegate overrides.
- virtual void GetAlternateColors(AlternateColors* alt_colors) OVERRIDE;
-
- // Record the specified action in the histogram for one-click sign in.
- void RecordHistogramAction(int action);
-
- // Information about the account that has just logged in.
- std::string session_index_;
- std::string email_;
- std::string password_;
-
- // Whether any UI controls in the infobar were pressed or not.
- bool button_pressed_;
-
- DISALLOW_COPY_AND_ASSIGN(OneClickInfoBarDelegateImpl);
-};
-
-// static
-void OneClickInfoBarDelegateImpl::Create(InfoBarService* infobar_service,
- const std::string& session_index,
- const std::string& email,
- const std::string& password) {
- infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>(
- new OneClickInfoBarDelegateImpl(infobar_service, session_index, email,
- password)));
-}
-
-OneClickInfoBarDelegateImpl::OneClickInfoBarDelegateImpl(
- InfoBarService* owner,
- const std::string& session_index,
- const std::string& email,
- const std::string& password)
- : OneClickSigninInfoBarDelegate(owner),
- session_index_(session_index),
- email_(email),
- password_(password),
- button_pressed_(false) {
- RecordHistogramAction(one_click_signin::HISTOGRAM_SHOWN);
-}
-
-OneClickInfoBarDelegateImpl::~OneClickInfoBarDelegateImpl() {
- if (!button_pressed_)
- RecordHistogramAction(one_click_signin::HISTOGRAM_IGNORED);
-}
-
-InfoBarDelegate::InfoBarAutomationType
- OneClickInfoBarDelegateImpl::GetInfoBarAutomationType() const {
- return ONE_CLICK_LOGIN_INFOBAR;
-}
-
-void OneClickInfoBarDelegateImpl::InfoBarDismissed() {
- RecordHistogramAction(one_click_signin::HISTOGRAM_DISMISSED);
- button_pressed_ = true;
-}
-
-gfx::Image* OneClickInfoBarDelegateImpl::GetIcon() const {
- return &ResourceBundle::GetSharedInstance().GetNativeImageNamed(
- IDR_INFOBAR_SYNC);
-}
-
-InfoBarDelegate::Type OneClickInfoBarDelegateImpl::GetInfoBarType() const {
- return PAGE_ACTION_TYPE;
-}
-
-string16 OneClickInfoBarDelegateImpl::GetMessageText() const {
- return l10n_util::GetStringUTF16(IDS_ONE_CLICK_SIGNIN_INFOBAR_MESSAGE);
-}
-
-string16 OneClickInfoBarDelegateImpl::GetButtonLabel(
- InfoBarButton button) const {
- return l10n_util::GetStringUTF16(
- (button == BUTTON_OK) ? IDS_ONE_CLICK_SIGNIN_INFOBAR_OK_BUTTON
- : IDS_ONE_CLICK_SIGNIN_INFOBAR_CANCEL_BUTTON);
-}
-
-bool OneClickInfoBarDelegateImpl::Accept() {
- Browser* browser = chrome::FindBrowserWithWebContents(web_contents());
- Profile* profile = Profile::FromBrowserContext(
- web_contents()->GetBrowserContext());
-
- // User has accepted one-click sign-in for this account. Never ask again for
- // this profile.
- SigninManager::DisableOneClickSignIn(profile);
- RecordHistogramAction(one_click_signin::HISTOGRAM_ACCEPTED);
- chrome::FindBrowserWithWebContents(web_contents())->window()->
- ShowOneClickSigninBubble(
- BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE,
- UTF8ToUTF16(email_),
- base::Bind(&StartSync,
- StartSyncArgs(profile, browser,
- OneClickSigninHelper::AUTO_ACCEPT_NONE,
- session_index_, email_, password_,
- false /* force_same_tab_navigation */)));
- button_pressed_ = true;
- return true;
-}
-
-bool OneClickInfoBarDelegateImpl::Cancel() {
- AddEmailToOneClickRejectedList(Profile::FromBrowserContext(
- web_contents()->GetBrowserContext()), email_);
- RecordHistogramAction(one_click_signin::HISTOGRAM_REJECTED);
- button_pressed_ = true;
- return true;
-}
-
-string16 OneClickInfoBarDelegateImpl::GetLinkText() const {
- return l10n_util::GetStringUTF16(IDS_LEARN_MORE);
-}
-
-bool OneClickInfoBarDelegateImpl::LinkClicked(
- WindowOpenDisposition disposition) {
- RecordHistogramAction(one_click_signin::HISTOGRAM_LEARN_MORE);
- content::OpenURLParams params(
- GURL(chrome::kChromeSyncLearnMoreURL), content::Referrer(),
- (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
- content::PAGE_TRANSITION_LINK, false);
- web_contents()->OpenURL(params);
- return false;
-}
-
-void OneClickInfoBarDelegateImpl::GetAlternateColors(
- AlternateColors* alt_colors) {
- if (use_blue_on_white) {
- alt_colors->enabled = true;
- alt_colors->infobar_bottom_color = SK_ColorWHITE;
- alt_colors->infobar_top_color = SK_ColorWHITE;
- alt_colors->button_text_color = SK_ColorWHITE;
- alt_colors->button_background_color = SkColorSetRGB(71, 135, 237);
- alt_colors->button_border_color = SkColorSetRGB(48, 121, 237);
- return;
- }
-
- return OneClickSigninInfoBarDelegate::GetAlternateColors(alt_colors);
-}
-
-void OneClickInfoBarDelegateImpl::RecordHistogramAction(int action) {
- UMA_HISTOGRAM_ENUMERATION("AutoLogin.Reverse", action,
- one_click_signin::HISTOGRAM_MAX);
-}
-
OneClickSigninHelper::OneClickSigninHelper(content::WebContents* web_contents)
: content::WebContentsObserver(web_contents),
showing_signin_(false),
@@ -828,21 +651,6 @@ OneClickSigninHelper::Offer OneClickSigninHelper::CanOfferOnIOThreadImpl(
}
// static
-void OneClickSigninHelper::InitializeFieldTrial() {
- scoped_refptr<base::FieldTrial> trial(
- base::FieldTrialList::FactoryGetFieldTrial("OneClickSignIn", 100,
- "Standard", 2013, 9, 1, NULL));
-
- // For dev and beta, we'll give half the people the new experience. For
- // stable, only 1%. These numbers are overridable on the server.
- const bool kIsStableChannel =
- chrome::VersionInfo::GetChannel() == chrome::VersionInfo::CHANNEL_STABLE;
- const int kBlueOnWhiteGroup = trial->AppendGroup("BlueOnWhite",
- kIsStableChannel ? 1 : 50);
- use_blue_on_white = trial->group() == kBlueOnWhiteGroup;
-}
-
-// static
void OneClickSigninHelper::ShowInfoBarIfPossible(net::URLRequest* request,
ProfileIOData* io_data,
int child_id,
@@ -1266,14 +1074,8 @@ void OneClickSigninHelper::DidStopLoading(
switch (auto_accept_) {
case AUTO_ACCEPT_NONE:
- if (SyncPromoUI::UseWebBasedSigninFlow()) {
- if (showing_signin_)
+ if (SyncPromoUI::UseWebBasedSigninFlow() && showing_signin_)
LogOneClickHistogramValue(one_click_signin::HISTOGRAM_DISMISSED);
- } else {
- OneClickInfoBarDelegateImpl::Create(
- InfoBarService::FromWebContents(contents), session_index_, email_,
- password_);
- }
break;
case AUTO_ACCEPT_ACCEPTED:
LogOneClickHistogramValue(one_click_signin::HISTOGRAM_ACCEPTED);
diff --git a/chrome/browser/ui/sync/one_click_signin_helper.h b/chrome/browser/ui/sync/one_click_signin_helper.h
index 33507c9..73c35db 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper.h
+++ b/chrome/browser/ui/sync/one_click_signin_helper.h
@@ -102,9 +102,6 @@ class OneClickSigninHelper
static Offer CanOfferOnIOThread(net::URLRequest* request,
ProfileIOData* io_data);
- // Initialize a finch experiment for the infobar.
- static void InitializeFieldTrial();
-
// Looks for the Google-Accounts-SignIn response header, and if found,
// tries to display an infobar in the tab contents identified by the
// child/route id.
diff --git a/chrome/browser/ui/sync/one_click_signin_infobar_delegate.cc b/chrome/browser/ui/sync/one_click_signin_infobar_delegate.cc
deleted file mode 100644
index c024607..0000000
--- a/chrome/browser/ui/sync/one_click_signin_infobar_delegate.cc
+++ /dev/null
@@ -1,18 +0,0 @@
-// 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.
-
-#include "chrome/browser/ui/sync/one_click_signin_infobar_delegate.h"
-
-OneClickSigninInfoBarDelegate::~OneClickSigninInfoBarDelegate() {
-}
-
-void OneClickSigninInfoBarDelegate::GetAlternateColors(
- AlternateColors* alt_colors) {
- alt_colors->enabled = false;
-}
-
-OneClickSigninInfoBarDelegate::OneClickSigninInfoBarDelegate(
- InfoBarService* infobar_service)
- : ConfirmInfoBarDelegate(infobar_service) {
-}
diff --git a/chrome/browser/ui/sync/one_click_signin_infobar_delegate.h b/chrome/browser/ui/sync/one_click_signin_infobar_delegate.h
deleted file mode 100644
index 4ec37f2..0000000
--- a/chrome/browser/ui/sync/one_click_signin_infobar_delegate.h
+++ /dev/null
@@ -1,48 +0,0 @@
-// 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.
-
-#ifndef CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_INFOBAR_DELEGATE_H_
-#define CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_INFOBAR_DELEGATE_H_
-
-#include "chrome/browser/infobars/confirm_infobar_delegate.h"
-#include "third_party/skia/include/core/SkColor.h"
-
-// An interface derived from ConfirmInfoBarDelegate implemented for the
-// one-click sign in inforbar experiments.
-class OneClickSigninInfoBarDelegate : public ConfirmInfoBarDelegate {
- public:
- // A set of alternate colours for the experiment. The colour values are only
- // used if |enabled| is true. Otherwise the infobar uses its default colours.
- struct AlternateColors {
- bool enabled;
- SkColor infobar_top_color;
- SkColor infobar_bottom_color;
- SkColor button_text_color;
- SkColor button_background_color;
- SkColor button_border_color;
- };
-
- virtual ~OneClickSigninInfoBarDelegate();
-
- // Returns the colours to use with the one click signin infobar. The colours
- // depend on the experimental group.
- virtual void GetAlternateColors(AlternateColors* alt_colors);
-
- protected:
- explicit OneClickSigninInfoBarDelegate(InfoBarService* infobar_service);
-
- private:
-#if defined(TOOLKIT_VIEWS)
- // Because the experiment is only running for views, only override this
- // function there. Other platforms that support one-click sign in will
- // create a regular confirm infobar with no support for colour changes.
-
- // InfoBarDelegate:
- virtual InfoBar* CreateInfoBar(InfoBarService* owner) OVERRIDE;
-#endif
-
- DISALLOW_COPY_AND_ASSIGN(OneClickSigninInfoBarDelegate);
-};
-
-#endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_INFOBAR_DELEGATE_H_
diff --git a/chrome/browser/ui/views/infobars/confirm_infobar.h b/chrome/browser/ui/views/infobars/confirm_infobar.h
index cc11c5b..74a615e 100644
--- a/chrome/browser/ui/views/infobars/confirm_infobar.h
+++ b/chrome/browser/ui/views/infobars/confirm_infobar.h
@@ -24,14 +24,9 @@ class ConfirmInfoBar : public InfoBarView,
public:
ConfirmInfoBar(InfoBarService* owner, ConfirmInfoBarDelegate* delegate);
- protected:
- // TODO(rogerta): These only need to be protected due to the
- // OneClickLoginInfoBar experiment and can be made private once that's
- // removed.
+ private:
virtual ~ConfirmInfoBar();
- views::LabelButton* ok_button() { return ok_button_; }
-
// InfoBarView:
virtual void Layout() OVERRIDE;
virtual void ViewHierarchyChanged(bool is_add,
@@ -44,7 +39,6 @@ class ConfirmInfoBar : public InfoBarView,
// views::LinkListener:
virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE;
- private:
ConfirmInfoBarDelegate* GetDelegate();
views::Label* label_;
diff --git a/chrome/browser/ui/views/infobars/infobar_background.cc b/chrome/browser/ui/views/infobars/infobar_background.cc
index e936e2f..2257e36 100644
--- a/chrome/browser/ui/views/infobars/infobar_background.cc
+++ b/chrome/browser/ui/views/infobars/infobar_background.cc
@@ -4,14 +4,17 @@
#include "chrome/browser/ui/views/infobars/infobar_background.h"
+#include "chrome/browser/infobars/infobar.h"
#include "chrome/browser/ui/views/infobars/infobar_view.h"
#include "third_party/skia/include/effects/SkGradientShader.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_utils.h"
#include "ui/views/view.h"
-InfoBarBackground::InfoBarBackground(SkColor top, SkColor bottom)
- : separator_color_(SK_ColorBLACK), top_color_(top), bottom_color_(bottom) {
+InfoBarBackground::InfoBarBackground(InfoBarDelegate::Type infobar_type)
+ : separator_color_(SK_ColorBLACK),
+ top_color_(GetInfoBarTopColor(infobar_type)),
+ bottom_color_(GetInfoBarBottomColor(infobar_type)) {
SetNativeControlColor(
color_utils::AlphaBlend(top_color_, bottom_color_, 128));
}
diff --git a/chrome/browser/ui/views/infobars/infobar_background.h b/chrome/browser/ui/views/infobars/infobar_background.h
index 464d602..ba04a88 100644
--- a/chrome/browser/ui/views/infobars/infobar_background.h
+++ b/chrome/browser/ui/views/infobars/infobar_background.h
@@ -6,11 +6,12 @@
#define CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_BACKGROUND_H_
#include "base/compiler_specific.h"
+#include "chrome/browser/infobars/infobar_delegate.h"
#include "ui/views/background.h"
class InfoBarBackground : public views::Background {
public:
- InfoBarBackground(SkColor top, SkColor bottom);
+ explicit InfoBarBackground(InfoBarDelegate::Type infobar_type);
virtual ~InfoBarBackground();
void set_separator_color(SkColor color) { separator_color_ = color; }
diff --git a/chrome/browser/ui/views/infobars/infobar_view.cc b/chrome/browser/ui/views/infobars/infobar_view.cc
index 8638467..39cb63e 100644
--- a/chrome/browser/ui/views/infobars/infobar_view.cc
+++ b/chrome/browser/ui/views/infobars/infobar_view.cc
@@ -61,9 +61,7 @@ InfoBarView::InfoBarView(InfoBarService* owner, InfoBarDelegate* delegate)
icon_(NULL),
close_button_(NULL) {
set_owned_by_client(); // InfoBar deletes itself at the appropriate time.
- set_background(new InfoBarBackground(
- GetInfoBarTopColor(delegate->GetInfoBarType()),
- GetInfoBarBottomColor(delegate->GetInfoBarType())));
+ set_background(new InfoBarBackground(delegate->GetInfoBarType()));
}
InfoBarView::~InfoBarView() {
diff --git a/chrome/browser/ui/views/infobars/one_click_signin_infobar.cc b/chrome/browser/ui/views/infobars/one_click_signin_infobar.cc
deleted file mode 100644
index cb58d38..0000000
--- a/chrome/browser/ui/views/infobars/one_click_signin_infobar.cc
+++ /dev/null
@@ -1,146 +0,0 @@
-// 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.
-
-#include "chrome/browser/ui/views/infobars/one_click_signin_infobar.h"
-
-#include "chrome/browser/defaults.h"
-#include "chrome/browser/ui/sync/one_click_signin_infobar_delegate.h"
-#include "chrome/browser/ui/views/infobars/infobar_background.h"
-#include "third_party/skia/include/core/SkColor.h"
-#include "third_party/skia/include/core/SkPaint.h"
-#include "third_party/skia/include/core/SkRect.h"
-#include "third_party/skia/include/core/SkScalar.h"
-#include "ui/gfx/canvas.h"
-#include "ui/gfx/skia_util.h"
-#include "ui/views/border.h"
-#include "ui/views/controls/button/custom_button.h"
-#include "ui/views/controls/button/label_button.h"
-
-namespace {
-
-// Preferred padding between text and edge.
-const int kPreferredPaddingHorizontal = 6;
-
-// A border used for infobar buttons using a custom colour.
-class InfoBarColoredButtonBorder : public views::Border {
- public:
- InfoBarColoredButtonBorder(SkColor background_color,
- SkColor border_color);
-
- private:
- // A helper function to easily perform colour darkening from the
- // constructor initializer list.
- static SkColor DarkenColor(SkColor color);
-
- // Border overrides:
- virtual void Paint(const views::View& view, gfx::Canvas* canvas) OVERRIDE;
- virtual gfx::Insets GetInsets() const OVERRIDE;
-
- virtual ~InfoBarColoredButtonBorder();
-
- const SkColor background_color_;
- const SkColor border_color_;
- const SkColor border_color_hot_;
-
- DISALLOW_COPY_AND_ASSIGN(InfoBarColoredButtonBorder);
-};
-
-InfoBarColoredButtonBorder::InfoBarColoredButtonBorder(
- SkColor background_color,
- SkColor border_color)
- : background_color_(background_color),
- border_color_(border_color),
- border_color_hot_(DarkenColor(border_color_)) {
-}
-
-// static
-SkColor InfoBarColoredButtonBorder::DarkenColor(SkColor color) {
- SkScalar hsv[3];
- SkColorToHSV(color, hsv);
- hsv[2] *= 0.8f;
- return SkHSVToColor(255, hsv);
-}
-
-void InfoBarColoredButtonBorder::Paint(const views::View& view,
- gfx::Canvas* canvas) {
- const views::CustomButton* button =
- static_cast<const views::CustomButton*>(&view);
- const views::CustomButton::ButtonState state = button->state();
-
- const SkScalar kRadius = 2.0;
-
- SkRect bounds(gfx::RectToSkRect(view.GetLocalBounds()));
- bounds.inset(0.5, 0.5);
-
- SkPaint paint;
- paint.setAntiAlias(true);
-
- paint.setStyle(SkPaint::kFill_Style);
- paint.setColor(background_color_);
- canvas->sk_canvas()->drawRoundRect(bounds, kRadius, kRadius, paint);
-
- paint.setStyle(SkPaint::kStroke_Style);
- paint.setColor(state == views::CustomButton::STATE_NORMAL ?
- border_color_ : border_color_hot_);
- canvas->sk_canvas()->drawRoundRect(bounds, kRadius, kRadius, paint);
-}
-
-gfx::Insets InfoBarColoredButtonBorder::GetInsets() const {
- return gfx::Insets(browser_defaults::kInfoBarBorderPaddingVertical,
- kPreferredPaddingHorizontal,
- browser_defaults::kInfoBarBorderPaddingVertical,
- kPreferredPaddingHorizontal);
-}
-
-InfoBarColoredButtonBorder::~InfoBarColoredButtonBorder() {
-}
-
-} // namespace
-
-
-// OneClickSigninInfoBarDelegate ----------------------------------------------
-
-InfoBar* OneClickSigninInfoBarDelegate::CreateInfoBar(InfoBarService* owner) {
- return new OneClickSigninInfoBar(owner, this);
-}
-
-
-// OneClickLoginInfoBar -------------------------------------------------------
-
-OneClickSigninInfoBar::OneClickSigninInfoBar(
- InfoBarService* owner,
- OneClickSigninInfoBarDelegate* delegate)
- : ConfirmInfoBar(owner, delegate),
- one_click_delegate_(delegate) {
- CHECK(one_click_delegate_);
-}
-
-OneClickSigninInfoBar::~OneClickSigninInfoBar() {
-}
-
-void OneClickSigninInfoBar::ViewHierarchyChanged(bool is_add,
- views::View* parent,
- views::View* child) {
- const bool fix_color = is_add && child == this && ok_button() == NULL;
-
- ConfirmInfoBar::ViewHierarchyChanged(is_add, parent, child);
-
- if (!fix_color || ok_button() == NULL)
- return;
-
- OneClickSigninInfoBarDelegate::AlternateColors alt_colors;
- one_click_delegate_->GetAlternateColors(&alt_colors);
- if (!alt_colors.enabled)
- return;
-
- set_background(new InfoBarBackground(alt_colors.infobar_top_color,
- alt_colors.infobar_bottom_color));
- ok_button()->set_border(new InfoBarColoredButtonBorder(
- alt_colors.button_background_color,
- alt_colors.button_border_color));
- ok_button()->SetTextColor(views::Button::STATE_NORMAL,
- alt_colors.button_text_color);
- ok_button()->SetTextColor(views::Button::STATE_HOVERED,
- alt_colors.button_text_color);
-}
diff --git a/chrome/browser/ui/views/infobars/one_click_signin_infobar.h b/chrome/browser/ui/views/infobars/one_click_signin_infobar.h
deleted file mode 100644
index 19c4927..0000000
--- a/chrome/browser/ui/views/infobars/one_click_signin_infobar.h
+++ /dev/null
@@ -1,32 +0,0 @@
-// 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.
-
-#ifndef CHROME_BROWSER_UI_VIEWS_INFOBARS_ONE_CLICK_SIGNIN_INFOBAR_H_
-#define CHROME_BROWSER_UI_VIEWS_INFOBARS_ONE_CLICK_SIGNIN_INFOBAR_H_
-
-#include "chrome/browser/ui/views/infobars/confirm_infobar.h"
-
-class OneClickSigninInfoBarDelegate;
-
-// A speialization of ConfirmInfoBar that allows changing the background
-// colour of the infobar as well as the colour of the OK button. The behaviour
-// remains the same.
-class OneClickSigninInfoBar : public ConfirmInfoBar {
- public:
- OneClickSigninInfoBar(InfoBarService* owner,
- OneClickSigninInfoBarDelegate* delegate);
- virtual ~OneClickSigninInfoBar();
-
- private:
- // ConfirmInfoBar overrides.
- virtual void ViewHierarchyChanged(bool is_add,
- views::View* parent,
- views::View* child) OVERRIDE;
-
- OneClickSigninInfoBarDelegate* one_click_delegate_;
-
- DISALLOW_COPY_AND_ASSIGN(OneClickSigninInfoBar);
-};
-
-#endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_ONE_CLICK_SIGNIN_INFOBAR_H_
diff --git a/chrome/browser/ui/views/infobars/translate_infobar_base.cc b/chrome/browser/ui/views/infobars/translate_infobar_base.cc
index f221bd2..a6a9f8d 100644
--- a/chrome/browser/ui/views/infobars/translate_infobar_base.cc
+++ b/chrome/browser/ui/views/infobars/translate_infobar_base.cc
@@ -5,7 +5,6 @@
#include "chrome/browser/ui/views/infobars/translate_infobar_base.h"
#include "base/utf_string_conversions.h"
-#include "chrome/browser/infobars/infobar.h"
#include "chrome/browser/translate/translate_infobar_delegate.h"
#include "chrome/browser/ui/views/infobars/after_translate_infobar.h"
#include "chrome/browser/ui/views/infobars/before_translate_infobar.h"
@@ -35,8 +34,7 @@ const int TranslateInfoBarBase::kButtonInLabelSpacing = 5;
TranslateInfoBarBase::TranslateInfoBarBase(InfoBarService* owner,
TranslateInfoBarDelegate* delegate)
: InfoBarView(owner, delegate),
- error_background_(GetInfoBarTopColor(InfoBarDelegate::WARNING_TYPE),
- GetInfoBarBottomColor(InfoBarDelegate::WARNING_TYPE)) {
+ error_background_(InfoBarDelegate::WARNING_TYPE) {
}
TranslateInfoBarBase::~TranslateInfoBarBase() {
diff --git a/chrome/chrome_browser_ui.gypi b/chrome/chrome_browser_ui.gypi
index 80dcc88..e012abd 100644
--- a/chrome/chrome_browser_ui.gypi
+++ b/chrome/chrome_browser_ui.gypi
@@ -1358,8 +1358,6 @@
'browser/ui/sync/one_click_signin_helper.cc',
'browser/ui/sync/one_click_signin_helper.h',
'browser/ui/sync/one_click_signin_histogram.h',
- 'browser/ui/sync/one_click_signin_infobar_delegate.cc',
- 'browser/ui/sync/one_click_signin_infobar_delegate.h',
'browser/ui/sync/one_click_signin_sync_starter.cc',
'browser/ui/sync/one_click_signin_sync_starter.h',
'browser/ui/sync/profile_signin_confirmation_helper.cc',
@@ -1672,8 +1670,6 @@
'browser/ui/views/infobars/infobar_label_button_border.h',
'browser/ui/views/infobars/infobar_view.cc',
'browser/ui/views/infobars/infobar_view.h',
- 'browser/ui/views/infobars/one_click_signin_infobar.cc',
- 'browser/ui/views/infobars/one_click_signin_infobar.h',
'browser/ui/views/infobars/translate_infobar_base.cc',
'browser/ui/views/infobars/translate_infobar_base.h',
'browser/ui/views/infobars/translate_language_menu_model.cc',
@@ -2333,12 +2329,8 @@
'browser/ui/sync/one_click_signin_helper.cc',
'browser/ui/sync/one_click_signin_helper.h',
'browser/ui/sync/one_click_signin_histogram.h',
- 'browser/ui/sync/one_click_signin_infobar_delegate.cc',
- 'browser/ui/sync/one_click_signin_infobar_delegate.h',
'browser/ui/sync/one_click_signin_sync_starter.cc',
'browser/ui/sync/one_click_signin_sync_starter.h',
- 'browser/ui/views/infobars/one_click_signin_infobar.cc',
- 'browser/ui/views/infobars/one_click_signin_infobar.h',
'browser/ui/views/sync/one_click_signin_bubble_view.cc',
'browser/ui/views/sync/one_click_signin_bubble_view.h',
]