summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-20 23:08:03 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-20 23:08:03 +0000
commitd461a1f9fecc1009a7c93b19f43ba69c4ef11afc (patch)
tree2dcc515e3ff2527bfad425d689659d9e4abd83b9
parent757bc599c40c339885be341b6e53306627c3431e (diff)
downloadchromium_src-d461a1f9fecc1009a7c93b19f43ba69c4ef11afc.zip
chromium_src-d461a1f9fecc1009a7c93b19f43ba69c4ef11afc.tar.gz
chromium_src-d461a1f9fecc1009a7c93b19f43ba69c4ef11afc.tar.bz2
Revert 258436 "Manage accounts in Vasquette should open profile ..."
This broke the Linux GTK build: http://build.chromium.org/p/chromium.linux/builders/Linux%20GTK%20Builder/builds/1872/steps/compile/logs/stdio because you didn't update BrowserWindowGtk also. Annoyingly, this build config isn't on the default trybots, but is on the waterfall. I think you can manually request this trybot, though. Sorry :-/ > Manage accounts in Vasquette should open profile menu in edit state > > BUG=335208 > > Review URL: https://codereview.chromium.org/205003004 TBR=guohui@chromium.org Review URL: https://codereview.chromium.org/206563005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258450 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/api/principals_private/principals_private_api.cc6
-rw-r--r--chrome/browser/signin/signin_header_helper.cc7
-rw-r--r--chrome/browser/ui/browser_commands.cc3
-rw-r--r--chrome/browser/ui/browser_window.h9
-rw-r--r--chrome/browser/ui/cocoa/browser_window_cocoa.h2
-rw-r--r--chrome/browser/ui/cocoa/browser_window_cocoa.mm3
-rw-r--r--chrome/browser/ui/views/avatar_label.cc3
-rw-r--r--chrome/browser/ui/views/avatar_menu_button.cc1
-rw-r--r--chrome/browser/ui/views/frame/browser_view.cc8
-rw-r--r--chrome/browser/ui/views/frame/browser_view.h2
-rw-r--r--chrome/browser/ui/views/frame/glass_browser_frame_view.cc6
-rw-r--r--chrome/browser/ui/views/frame/opaque_browser_frame_view.cc14
-rw-r--r--chrome/browser/ui/views/profile_chooser_view.cc46
-rw-r--r--chrome/browser/ui/views/profile_chooser_view.h24
-rw-r--r--chrome/test/base/test_browser_window.h3
15 files changed, 55 insertions, 82 deletions
diff --git a/chrome/browser/extensions/api/principals_private/principals_private_api.cc b/chrome/browser/extensions/api/principals_private/principals_private_api.cc
index 0b7b8b9..b4fa4a2 100644
--- a/chrome/browser/extensions/api/principals_private/principals_private_api.cc
+++ b/chrome/browser/extensions/api/principals_private/principals_private_api.cc
@@ -32,10 +32,8 @@ bool PrincipalsPrivateSignOutFunction::RunImplSafe() {
bool PrincipalsPrivateShowAvatarBubbleFunction::RunImplSafe() {
Browser* browser = GetCurrentBrowser();
- if (browser) {
- browser->window()->ShowAvatarBubbleFromAvatarButton(
- BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT);
- }
+ if (browser)
+ browser->window()->ShowAvatarBubbleFromAvatarButton();
return true;
}
diff --git a/chrome/browser/signin/signin_header_helper.cc b/chrome/browser/signin/signin_header_helper.cc
index b43c4ba..78c6a4f 100644
--- a/chrome/browser/signin/signin_header_helper.cc
+++ b/chrome/browser/signin/signin_header_helper.cc
@@ -36,10 +36,9 @@ void ShowAvatarBubbleUIThread(int child_id, int route_id) {
#if !defined(OS_ANDROID)
Browser* browser = chrome::FindBrowserWithWebContents(web_contents);
- if (browser) {
- browser->window()->ShowAvatarBubbleFromAvatarButton(
- BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT);
- }
+ if (browser)
+ browser->window()->ShowAvatarBubbleFromAvatarButton();
+ // TODO(guohui): need to handle the case when avatar button is not available.
#else // defined(OS_ANDROID)
AccountManagementScreenHelper::OpenAccountManagementScreen(
Profile::FromBrowserContext(web_contents->GetBrowserContext()));
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc
index 701d17d..c76ba26 100644
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -1042,8 +1042,7 @@ void ShowAppMenu(Browser* browser) {
}
void ShowAvatarMenu(Browser* browser) {
- browser->window()->ShowAvatarBubbleFromAvatarButton(
- BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT);
+ browser->window()->ShowAvatarBubbleFromAvatarButton();
}
void OpenUpdateChromeDialog(Browser* browser) {
diff --git a/chrome/browser/ui/browser_window.h b/chrome/browser/ui/browser_window.h
index 226033b..2577304 100644
--- a/chrome/browser/ui/browser_window.h
+++ b/chrome/browser/ui/browser_window.h
@@ -367,13 +367,8 @@ class BrowserWindow : public ui::BaseWindow {
virtual void ShowAvatarBubble(content::WebContents* web_contents,
const gfx::Rect& rect) = 0;
- // Shows the avatar bubble on the window frame off of the avatar button with
- // the given mode.
- enum AvatarBubbleMode {
- AVATAR_BUBBLE_MODE_DEFAULT,
- AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT
- };
- virtual void ShowAvatarBubbleFromAvatarButton(AvatarBubbleMode mode) = 0;
+ // Shows the avatar bubble on the window frame off of the avatar button.
+ virtual void ShowAvatarBubbleFromAvatarButton() = 0;
// Show bubble for password generation positioned relative to |rect|. The
// subclasses implementing this interface do not own the |password_generator|
diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.h b/chrome/browser/ui/cocoa/browser_window_cocoa.h
index f8bb00b..2a6f784 100644
--- a/chrome/browser/ui/cocoa/browser_window_cocoa.h
+++ b/chrome/browser/ui/cocoa/browser_window_cocoa.h
@@ -148,7 +148,7 @@ class BrowserWindowCocoa :
GetWebContentsModalDialogHost() OVERRIDE;
virtual void ShowAvatarBubble(content::WebContents* web_contents,
const gfx::Rect& rect) OVERRIDE;
- virtual void ShowAvatarBubbleFromAvatarButton(AvatarBubbleMode mode) OVERRIDE;
+ virtual void ShowAvatarBubbleFromAvatarButton() OVERRIDE;
virtual void ShowPasswordGenerationBubble(
const gfx::Rect& rect,
const autofill::PasswordForm& form,
diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
index 3ea60f6..c1e1854 100644
--- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
@@ -705,8 +705,7 @@ void BrowserWindowCocoa::ShowAvatarBubble(WebContents* web_contents,
[menu showWindow:nil];
}
-void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton(
- AvatarBubbleMode mode) {
+void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() {
AvatarBaseController* controller = [controller_ avatarButtonController];
[controller showAvatarBubble:[controller buttonView]];
}
diff --git a/chrome/browser/ui/views/avatar_label.cc b/chrome/browser/ui/views/avatar_label.cc
index 6f77339..65ae8fc 100644
--- a/chrome/browser/ui/views/avatar_label.cc
+++ b/chrome/browser/ui/views/avatar_label.cc
@@ -104,8 +104,7 @@ bool AvatarLabel::OnMousePressed(const ui::MouseEvent& event) {
if (!LabelButton::OnMousePressed(event))
return false;
- browser_view_->ShowAvatarBubbleFromAvatarButton(
- BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT);
+ browser_view_->ShowAvatarBubbleFromAvatarButton();
return true;
}
diff --git a/chrome/browser/ui/views/avatar_menu_button.cc b/chrome/browser/ui/views/avatar_menu_button.cc
index c4268bb..e9942f5 100644
--- a/chrome/browser/ui/views/avatar_menu_button.cc
+++ b/chrome/browser/ui/views/avatar_menu_button.cc
@@ -107,7 +107,6 @@ void AvatarMenuButton::ShowAvatarBubble() {
views::BubbleBorder::TOP_RIGHT : views::BubbleBorder::TOP_LEFT;
if (switches::IsNewProfileManagement()) {
ProfileChooserView::ShowBubble(
- ProfileChooserView::BUBBLE_VIEW_MODE_PROFILE_CHOOSER,
this, arrow, views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR, bounds,
browser_);
} else {
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 2cf055e..5d332a5f 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -2413,7 +2413,7 @@ void BrowserView::ShowAvatarBubble(WebContents* web_contents,
views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, bounds, browser_.get());
}
-void BrowserView::ShowAvatarBubbleFromAvatarButton(AvatarBubbleMode mode) {
+void BrowserView::ShowAvatarBubbleFromAvatarButton() {
if (switches::IsNewProfileManagement()) {
NewAvatarButton* button = frame_->GetNewAvatarMenuButton();
if (button) {
@@ -2421,12 +2421,8 @@ void BrowserView::ShowAvatarBubbleFromAvatarButton(AvatarBubbleMode mode) {
views::View::ConvertPointToScreen(button, &origin);
gfx::Rect bounds(origin, size());
- ProfileChooserView::BubbleViewMode view_mode =
- mode == BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT ?
- ProfileChooserView::BUBBLE_VIEW_MODE_PROFILE_CHOOSER :
- ProfileChooserView::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT;
ProfileChooserView::ShowBubble(
- view_mode, button, views::BubbleBorder::TOP_RIGHT,
+ button, views::BubbleBorder::TOP_RIGHT,
views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, bounds, browser());
}
} else {
diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h
index d57ba00..bc44061 100644
--- a/chrome/browser/ui/views/frame/browser_view.h
+++ b/chrome/browser/ui/views/frame/browser_view.h
@@ -376,7 +376,7 @@ class BrowserView : public BrowserWindow,
GetWebContentsModalDialogHost() OVERRIDE;
virtual void ShowAvatarBubble(content::WebContents* web_contents,
const gfx::Rect& rect) OVERRIDE;
- virtual void ShowAvatarBubbleFromAvatarButton(AvatarBubbleMode mode) OVERRIDE;
+ virtual void ShowAvatarBubbleFromAvatarButton() OVERRIDE;
virtual void ShowPasswordGenerationBubble(
const gfx::Rect& rect,
const autofill::PasswordForm& form,
diff --git a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
index 0b154a3..472dcad 100644
--- a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
@@ -285,10 +285,8 @@ bool GlassBrowserFrameView::HitTestRect(const gfx::Rect& rect) const {
// GlassBrowserFrameView, views::ButtonListener overrides:
void GlassBrowserFrameView::ButtonPressed(views::Button* sender,
const ui::Event& event) {
- if (sender == new_avatar_button()) {
- browser_view()->ShowAvatarBubbleFromAvatarButton(
- BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT);
- }
+ if (sender == new_avatar_button())
+ browser_view()->ShowAvatarBubbleFromAvatarButton();
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
index 00f6469..36d1896 100644
--- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
@@ -362,18 +362,16 @@ void OpaqueBrowserFrameView::GetAccessibleState(
void OpaqueBrowserFrameView::ButtonPressed(views::Button* sender,
const ui::Event& event) {
- if (sender == minimize_button_) {
+ if (sender == minimize_button_)
frame()->Minimize();
- } else if (sender == maximize_button_) {
+ else if (sender == maximize_button_)
frame()->Maximize();
- } else if (sender == restore_button_) {
+ else if (sender == restore_button_)
frame()->Restore();
- } else if (sender == close_button_) {
+ else if (sender == close_button_)
frame()->Close();
- } else if (sender == new_avatar_button()) {
- browser_view()->ShowAvatarBubbleFromAvatarButton(
- BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT);
- }
+ else if (sender == new_avatar_button())
+ browser_view()->ShowAvatarBubbleFromAvatarButton();
}
void OpaqueBrowserFrameView::OnMenuButtonClicked(views::View* source,
diff --git a/chrome/browser/ui/views/profile_chooser_view.cc b/chrome/browser/ui/views/profile_chooser_view.cc
index 44e1efd..77f55ec 100644
--- a/chrome/browser/ui/views/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profile_chooser_view.cc
@@ -292,12 +292,15 @@ bool ProfileChooserView::close_on_deactivate_for_testing_ = true;
// static
void ProfileChooserView::ShowBubble(
- BubbleViewMode view_mode,
views::View* anchor_view,
views::BubbleBorder::Arrow arrow,
views::BubbleBorder::BubbleAlignment border_alignment,
const gfx::Rect& anchor_rect,
Browser* browser) {
+ if (IsShowing())
+ // TODO(bcwhite): handle case where we should show on different window
+ return;
+
profile_bubble_ = new ProfileChooserView(
anchor_view, arrow, anchor_rect, browser);
views::BubbleDelegateView::CreateBubble(profile_bubble_);
@@ -305,9 +308,6 @@ void ProfileChooserView::ShowBubble(
profile_bubble_->SetAlignment(border_alignment);
profile_bubble_->GetWidget()->Show();
profile_bubble_->SetArrowPaintType(views::BubbleBorder::PAINT_NONE);
-
- if (view_mode != BUBBLE_VIEW_MODE_PROFILE_CHOOSER)
- profile_bubble_->ShowView(view_mode, profile_bubble_->avatar_menu_.get());
}
// static
@@ -327,7 +327,7 @@ ProfileChooserView::ProfileChooserView(views::View* anchor_view,
Browser* browser)
: BubbleDelegateView(anchor_view, arrow),
browser_(browser),
- view_mode_(BUBBLE_VIEW_MODE_PROFILE_CHOOSER),
+ view_mode_(PROFILE_CHOOSER_VIEW),
tutorial_showing_(false) {
// Reset the default margins inherited from the BubbleDelegateView.
set_margins(gfx::Insets());
@@ -372,7 +372,7 @@ void ProfileChooserView::ResetView() {
}
void ProfileChooserView::Init() {
- ShowView(BUBBLE_VIEW_MODE_PROFILE_CHOOSER, avatar_menu_.get());
+ ShowView(PROFILE_CHOOSER_VIEW, avatar_menu_.get());
}
void ProfileChooserView::OnAvatarMenuChanged(
@@ -380,32 +380,32 @@ void ProfileChooserView::OnAvatarMenuChanged(
// Refresh the view with the new menu. We can't just update the local copy
// as this may have been triggered by a sign out action, in which case
// the view is being destroyed.
- ShowView(BUBBLE_VIEW_MODE_PROFILE_CHOOSER, avatar_menu);
+ ShowView(PROFILE_CHOOSER_VIEW, avatar_menu);
}
void ProfileChooserView::OnRefreshTokenAvailable(
const std::string& account_id) {
// Refresh the account management view when a new account is added to the
// profile.
- if (view_mode_ == BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT ||
- view_mode_ == BUBBLE_VIEW_MODE_GAIA_SIGNIN ||
- view_mode_ == BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT) {
- ShowView(BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT, avatar_menu_.get());
+ if (view_mode_ == ACCOUNT_MANAGEMENT_VIEW ||
+ view_mode_ == GAIA_SIGNIN_VIEW ||
+ view_mode_ == GAIA_ADD_ACCOUNT_VIEW) {
+ ShowView(ACCOUNT_MANAGEMENT_VIEW, avatar_menu_.get());
}
}
void ProfileChooserView::OnRefreshTokenRevoked(const std::string& account_id) {
// Refresh the account management view when an account is removed from the
// profile.
- if (view_mode_ == BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT)
- ShowView(BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT, avatar_menu_.get());
+ if (view_mode_ == ACCOUNT_MANAGEMENT_VIEW)
+ ShowView(ACCOUNT_MANAGEMENT_VIEW, avatar_menu_.get());
}
void ProfileChooserView::ShowView(BubbleViewMode view_to_display,
AvatarMenu* avatar_menu) {
// The account management view should only be displayed if the active profile
// is signed in.
- if (view_to_display == BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT) {
+ if (view_to_display == ACCOUNT_MANAGEMENT_VIEW) {
const AvatarMenu::Item& active_item = avatar_menu->GetItemAt(
avatar_menu->GetActiveProfileIndex());
DCHECK(active_item.signed_in);
@@ -417,14 +417,14 @@ void ProfileChooserView::ShowView(BubbleViewMode view_to_display,
RemoveAllChildViews(true);
view_mode_ = view_to_display;
- if (view_to_display == BUBBLE_VIEW_MODE_GAIA_SIGNIN ||
- view_to_display == BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT) {
+ if (view_to_display == GAIA_SIGNIN_VIEW ||
+ view_to_display == GAIA_ADD_ACCOUNT_VIEW) {
// Minimum size for embedded sign in pages as defined in Gaia.
const int kMinGaiaViewWidth = 320;
const int kMinGaiaViewHeight = 440;
Profile* profile = browser_->profile();
views::WebView* web_view = new views::WebView(profile);
- signin::Source source = (view_to_display == BUBBLE_VIEW_MODE_GAIA_SIGNIN) ?
+ signin::Source source = (view_to_display == GAIA_SIGNIN_VIEW) ?
signin::SOURCE_AVATAR_BUBBLE_SIGN_IN :
signin::SOURCE_AVATAR_BUBBLE_ADD_ACCOUNT;
GURL url(signin::GetPromoURL(
@@ -452,7 +452,7 @@ void ProfileChooserView::ShowView(BubbleViewMode view_to_display,
for (size_t i = 0; i < avatar_menu->GetNumberOfItems(); ++i) {
const AvatarMenu::Item& item = avatar_menu->GetItemAt(i);
if (item.active) {
- if (view_to_display == BUBBLE_VIEW_MODE_PROFILE_CHOOSER) {
+ if (view_to_display == PROFILE_CHOOSER_VIEW) {
tutorial_view = CreateTutorialView(item, tutorial_shown);
current_profile_view = CreateCurrentProfileView(item, false);
} else {
@@ -478,7 +478,7 @@ void ProfileChooserView::ShowView(BubbleViewMode view_to_display,
layout->StartRow(1, 0);
layout->AddView(current_profile_view);
- if (view_to_display == BUBBLE_VIEW_MODE_PROFILE_CHOOSER) {
+ if (view_to_display == PROFILE_CHOOSER_VIEW) {
layout->StartRow(1, 0);
layout->AddView(CreateOtherProfilesView(other_profiles));
} else {
@@ -534,7 +534,7 @@ void ProfileChooserView::ButtonPressed(views::Button* sender,
profiles::ProfileSwitchingDoneCallback(),
ProfileMetrics::ADD_NEW_USER_ICON);
} else if (sender == add_account_button_) {
- ShowView(BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT, avatar_menu_.get());
+ ShowView(GAIA_ADD_ACCOUNT_VIEW, avatar_menu_.get());
} else if (sender == current_profile_photo_->change_photo_button()) {
avatar_menu_->EditProfile(avatar_menu_->GetActiveProfileIndex());
} else if (sender == tutorial_ok_button_) {
@@ -544,7 +544,7 @@ void ProfileChooserView::ButtonPressed(views::Button* sender,
// is indeed shown for the maximum number of times.
browser_->profile()->GetPrefs()->SetInteger(
prefs::kProfileAvatarTutorialShown, kProfileAvatarTutorialShowMax + 1);
- ShowView(BUBBLE_VIEW_MODE_PROFILE_CHOOSER, avatar_menu_.get());
+ ShowView(PROFILE_CHOOSER_VIEW, avatar_menu_.get());
} else {
// One of the "other profiles" buttons was pressed.
ButtonIndexes::const_iterator match =
@@ -573,7 +573,7 @@ void ProfileChooserView::OnMenuButtonClicked(views::View* source,
void ProfileChooserView::LinkClicked(views::Link* sender, int event_flags) {
if (sender == manage_accounts_link_) {
// ShowView() will DCHECK if this view is displayed for non signed-in users.
- ShowView(BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT, avatar_menu_.get());
+ ShowView(ACCOUNT_MANAGEMENT_VIEW, avatar_menu_.get());
} else if (sender == signout_current_profile_link_) {
profiles::LockProfile(browser_->profile());
} else if (sender == tutorial_learn_more_link_) {
@@ -587,7 +587,7 @@ void ProfileChooserView::LinkClicked(views::Link* sender, int event_flags) {
chrome::Navigate(&params);
} else {
DCHECK(sender == signin_current_profile_link_);
- ShowView(BUBBLE_VIEW_MODE_GAIA_SIGNIN, avatar_menu_.get());
+ ShowView(GAIA_SIGNIN_VIEW, avatar_menu_.get());
}
}
diff --git a/chrome/browser/ui/views/profile_chooser_view.h b/chrome/browser/ui/views/profile_chooser_view.h
index 1a2e0fd..3cfb113 100644
--- a/chrome/browser/ui/views/profile_chooser_view.h
+++ b/chrome/browser/ui/views/profile_chooser_view.h
@@ -10,7 +10,6 @@
#include "chrome/browser/profiles/avatar_menu.h"
#include "chrome/browser/profiles/avatar_menu_observer.h"
-#include "chrome/browser/ui/browser_window.h"
#include "google_apis/gaia/oauth2_token_service.h"
#include "ui/views/bubble/bubble_delegate.h"
#include "ui/views/controls/button/button.h"
@@ -44,25 +43,12 @@ class ProfileChooserView : public views::BubbleDelegateView,
public AvatarMenuObserver,
public OAuth2TokenService::Observer {
public:
- // Different views that can be displayed in the bubble.
- enum BubbleViewMode {
- // Shows a "fast profile switcher" view.
- BUBBLE_VIEW_MODE_PROFILE_CHOOSER,
- // Shows a list of accounts for the active user.
- BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT,
- // Shows a web view for primary sign in.
- BUBBLE_VIEW_MODE_GAIA_SIGNIN,
- // Shows a web view for adding secondary accounts.
- BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT
- };
-
// Shows the bubble if one is not already showing. This allows us to easily
// make a button toggle the bubble on and off when clicked: we unconditionally
// call this function when the button is clicked and if the bubble isn't
// showing it will appear while if it is showing, nothing will happen here and
// the existing bubble will auto-close due to focus loss.
- static void ShowBubble(BubbleViewMode view_mode,
- views::View* anchor_view,
+ static void ShowBubble(views::View* anchor_view,
views::BubbleBorder::Arrow arrow,
views::BubbleBorder::BubbleAlignment border_alignment,
const gfx::Rect& anchor_rect,
@@ -85,6 +71,14 @@ class ProfileChooserView : public views::BubbleDelegateView,
typedef std::map<views::Button*, int> ButtonIndexes;
typedef std::map<views::View*, std::string> AccountButtonIndexes;
+ // Different views that can be displayed in the bubble.
+ enum BubbleViewMode {
+ PROFILE_CHOOSER_VIEW, // Shows a "fast profile switcher" view.
+ ACCOUNT_MANAGEMENT_VIEW, // Shows a list of accounts for the active user.
+ GAIA_SIGNIN_VIEW, // Shows a web view for primary sign in.
+ GAIA_ADD_ACCOUNT_VIEW // Shows a web view for adding secondary accounts.
+ };
+
ProfileChooserView(views::View* anchor_view,
views::BubbleBorder::Arrow arrow,
const gfx::Rect& anchor_rect,
diff --git a/chrome/test/base/test_browser_window.h b/chrome/test/base/test_browser_window.h
index 90569d0..80a90c9 100644
--- a/chrome/test/base/test_browser_window.h
+++ b/chrome/test/base/test_browser_window.h
@@ -145,8 +145,7 @@ class TestBrowserWindow : public BrowserWindow {
GetWebContentsModalDialogHost() OVERRIDE;
virtual void ShowAvatarBubble(content::WebContents* web_contents,
const gfx::Rect& rect) OVERRIDE {}
- virtual void ShowAvatarBubbleFromAvatarButton(AvatarBubbleMode mode)
- OVERRIDE {}
+ virtual void ShowAvatarBubbleFromAvatarButton() OVERRIDE {}
virtual void ShowPasswordGenerationBubble(
const gfx::Rect& rect,
const autofill::PasswordForm& form,