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

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 297803007: Move profile_chooser enums to a constant place for mac and win. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unit tests need love too Created 6 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/frame/browser_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 2372 matching lines...) Expand 10 before | Expand all | Expand 10 after
2383 } 2383 }
2384 2384
2385 void BrowserView::ShowAvatarBubbleFromAvatarButton(AvatarBubbleMode mode) { 2385 void BrowserView::ShowAvatarBubbleFromAvatarButton(AvatarBubbleMode mode) {
2386 if (switches::IsNewAvatarMenu()) { 2386 if (switches::IsNewAvatarMenu()) {
2387 NewAvatarButton* button = frame_->GetNewAvatarMenuButton(); 2387 NewAvatarButton* button = frame_->GetNewAvatarMenuButton();
2388 if (button) { 2388 if (button) {
2389 gfx::Point origin; 2389 gfx::Point origin;
2390 views::View::ConvertPointToScreen(button, &origin); 2390 views::View::ConvertPointToScreen(button, &origin);
2391 gfx::Rect bounds(origin, size()); 2391 gfx::Rect bounds(origin, size());
2392 2392
2393 ProfileChooserView::BubbleViewMode view_mode; 2393 profiles::BubbleViewMode view_mode;
2394 switch (mode) { 2394 switch (mode) {
2395 case AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT: 2395 case AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT:
2396 view_mode = ProfileChooserView::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT; 2396 view_mode = profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT;
2397 break; 2397 break;
2398 case AVATAR_BUBBLE_MODE_SIGNIN: 2398 case AVATAR_BUBBLE_MODE_SIGNIN:
2399 view_mode = ProfileChooserView::BUBBLE_VIEW_MODE_GAIA_SIGNIN; 2399 view_mode = profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN;
2400 break; 2400 break;
2401 case AVATAR_BUBBLE_MODE_REAUTH: 2401 case AVATAR_BUBBLE_MODE_REAUTH:
2402 view_mode = ProfileChooserView::BUBBLE_VIEW_MODE_GAIA_REAUTH; 2402 view_mode = profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH;
2403 break; 2403 break;
2404 default: 2404 default:
2405 view_mode = ProfileChooserView::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; 2405 view_mode = profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER;
2406 break; 2406 break;
2407 } 2407 }
2408 2408
2409 ProfileChooserView::ShowBubble( 2409 ProfileChooserView::ShowBubble(
2410 view_mode, button, views::BubbleBorder::TOP_RIGHT, 2410 view_mode, button, views::BubbleBorder::TOP_RIGHT,
2411 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, bounds, browser()); 2411 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, bounds, browser());
2412 } 2412 }
2413 } else { 2413 } else {
2414 views::BubbleBorder::Arrow arrow = views::BubbleBorder::TOP_RIGHT; 2414 views::BubbleBorder::Arrow arrow = views::BubbleBorder::TOP_RIGHT;
2415 views::View* anchor_view = frame_->GetAvatarMenuButton(); 2415 views::View* anchor_view = frame_->GetAvatarMenuButton();
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
2553 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { 2553 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) {
2554 gfx::Point icon_bottom( 2554 gfx::Point icon_bottom(
2555 toolbar_->location_bar()->GetLocationBarAnchorPoint()); 2555 toolbar_->location_bar()->GetLocationBarAnchorPoint());
2556 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); 2556 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom);
2557 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); 2557 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL));
2558 ConvertPointToTarget(infobar_container_, this, &infobar_top); 2558 ConvertPointToTarget(infobar_container_, this, &infobar_top);
2559 top_arrow_height = infobar_top.y() - icon_bottom.y(); 2559 top_arrow_height = infobar_top.y() - icon_bottom.y();
2560 } 2560 }
2561 return top_arrow_height; 2561 return top_arrow_height;
2562 } 2562 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/profile_chooser_constants.h ('k') | chrome/browser/ui/views/profiles/profile_chooser_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698