Commit 97845f25 authored by yiyaoliu@chromium.org's avatar yiyaoliu@chromium.org

Renamed the method and variable name in derived class so that the method in...

Renamed the method and variable name in derived class so that the method in based class will not be overridden. 

BUG=270888

Review URL: https://codereview.chromium.org/51113006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233440 0039d316-1c4b-4281-b951-d872f2087c98
parent 2c12d398
......@@ -477,7 +477,7 @@ ActionButtonView::ActionButtonView(views::ButtonListener* listener,
// static
AvatarMenuBubbleView* AvatarMenuBubbleView::avatar_bubble_ = NULL;
bool AvatarMenuBubbleView::close_on_deactivate_ = true;
bool AvatarMenuBubbleView::close_on_deactivate_for_testing_ = true;
// static
void AvatarMenuBubbleView::ShowBubble(
......@@ -493,7 +493,7 @@ void AvatarMenuBubbleView::ShowBubble(
avatar_bubble_ = new AvatarMenuBubbleView(
anchor_view, arrow, anchor_rect, browser);
views::BubbleDelegateView::CreateBubble(avatar_bubble_);
avatar_bubble_->set_close_on_deactivate(close_on_deactivate_);
avatar_bubble_->set_close_on_deactivate(close_on_deactivate_for_testing_);
avatar_bubble_->SetBackgroundColors();
avatar_bubble_->SetAlignment(border_alignment);
avatar_bubble_->GetWidget()->Show();
......
......@@ -82,8 +82,8 @@ class AvatarMenuBubbleView : public views::BubbleDelegateView,
// We normally close the bubble any time it becomes inactive but this can lead
// to flaky tests where unexpected UI events are triggering this behavior.
// Tests should call this with "false" for more consistent operation.
static void set_close_on_deactivate(bool close) {
close_on_deactivate_ = close;
static void clear_close_on_deactivate_for_testing() {
close_on_deactivate_for_testing_ = false;
}
private:
......@@ -125,7 +125,7 @@ class AvatarMenuBubbleView : public views::BubbleDelegateView,
views::Link* switch_profile_link_;
static AvatarMenuBubbleView* avatar_bubble_;
static bool close_on_deactivate_;
static bool close_on_deactivate_for_testing_;
// Is set to true if the managed user has clicked on Switch Users.
bool expanded_;
......
......@@ -64,7 +64,7 @@ void AvatarMenuButtonTest::StartAvatarMenu() {
AvatarMenuButton* button = GetAvatarMenuButton();
ASSERT_TRUE(button);
AvatarMenuBubbleView::set_close_on_deactivate(false);
AvatarMenuBubbleView::clear_close_on_deactivate_for_testing();
static_cast<views::MenuButtonListener*>(button)->OnMenuButtonClicked(
NULL, gfx::Point());
base::MessageLoop::current()->RunUntilIdle();
......
......@@ -82,7 +82,7 @@ void NewAvatarMenuButtonTest::StartAvatarMenu() {
ASSERT_TRUE(button);
ASSERT_FALSE(browser_view->frame()->GetAvatarMenuButton());
ProfileChooserView::set_close_on_deactivate(false);
ProfileChooserView::clear_close_on_deactivate_for_testing();
ui::MouseEvent mouse_ev(ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(), 0);
button->NotifyClick(mouse_ev);
base::MessageLoop::current()->RunUntilIdle();
......
......@@ -183,7 +183,7 @@ class BackgroundColorHoverButton : public views::TextButton {
// static
ProfileChooserView* ProfileChooserView::profile_bubble_ = NULL;
bool ProfileChooserView::close_on_deactivate_ = true;
bool ProfileChooserView::close_on_deactivate_for_testing_ = true;
// static
void ProfileChooserView::ShowBubble(
......@@ -199,7 +199,7 @@ void ProfileChooserView::ShowBubble(
profile_bubble_ = new ProfileChooserView(
anchor_view, arrow, anchor_rect, browser);
views::BubbleDelegateView::CreateBubble(profile_bubble_);
profile_bubble_->set_close_on_deactivate(close_on_deactivate_);
profile_bubble_->set_close_on_deactivate(close_on_deactivate_for_testing_);
profile_bubble_->SetAlignment(border_alignment);
profile_bubble_->GetWidget()->Show();
profile_bubble_->SetArrowPaintType(views::BubbleBorder::PAINT_NONE);
......@@ -269,22 +269,22 @@ void ProfileChooserView::OnAvatarMenuChanged(
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_ == ACCOUNT_MANAGEMENT_VIEW ||
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_ == 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_ == ACCOUNT_MANAGEMENT_VIEW)
ShowView(ACCOUNT_MANAGEMENT_VIEW, avatar_menu_.get());
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_ == ACCOUNT_MANAGEMENT_VIEW)
ShowView(ACCOUNT_MANAGEMENT_VIEW, avatar_menu_.get());
}
void ProfileChooserView::ShowView(BubbleViewMode view_to_display,
......
......@@ -53,8 +53,8 @@ class ProfileChooserView : public views::BubbleDelegateView,
// We normally close the bubble any time it becomes inactive but this can lead
// to flaky tests where unexpected UI events are triggering this behavior.
// Tests should call this with "false" for more consistent operation.
static void set_close_on_deactivate(bool close) {
close_on_deactivate_ = close;
static void clear_close_on_deactivate_for_testing() {
close_on_deactivate_for_testing_ = false;
}
private:
......@@ -92,12 +92,12 @@ class ProfileChooserView : public views::BubbleDelegateView,
// AvatarMenuObserver:
virtual void OnAvatarMenuChanged(AvatarMenu* avatar_menu) OVERRIDE;
// OAuth2TokenService::Observer overrides.
virtual void OnRefreshTokenAvailable(const std::string& account_id) OVERRIDE;
// OAuth2TokenService::Observer overrides.
virtual void OnRefreshTokenAvailable(const std::string& account_id) OVERRIDE;
virtual void OnRefreshTokenRevoked(const std::string& account_id) OVERRIDE;
static ProfileChooserView* profile_bubble_;
static bool close_on_deactivate_;
static bool close_on_deactivate_for_testing_;
void ResetLinksAndButtons();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment