| OLD | NEW |
| 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 2364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2375 } | 2375 } |
| 2376 | 2376 |
| 2377 void BrowserView::ShowAvatarBubbleFromAvatarButton(AvatarBubbleMode mode) { | 2377 void BrowserView::ShowAvatarBubbleFromAvatarButton(AvatarBubbleMode mode) { |
| 2378 if (switches::IsNewAvatarMenu()) { | 2378 if (switches::IsNewAvatarMenu()) { |
| 2379 NewAvatarButton* button = frame_->GetNewAvatarMenuButton(); | 2379 NewAvatarButton* button = frame_->GetNewAvatarMenuButton(); |
| 2380 if (button) { | 2380 if (button) { |
| 2381 gfx::Point origin; | 2381 gfx::Point origin; |
| 2382 views::View::ConvertPointToScreen(button, &origin); | 2382 views::View::ConvertPointToScreen(button, &origin); |
| 2383 gfx::Rect bounds(origin, size()); | 2383 gfx::Rect bounds(origin, size()); |
| 2384 | 2384 |
| 2385 ProfileChooserView::BubbleViewMode view_mode = | 2385 ProfileChooserView::BubbleViewMode view_mode; |
| 2386 (mode == BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT) ? | 2386 switch (mode) { |
| 2387 ProfileChooserView::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT : | 2387 case AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT: |
| 2388 ProfileChooserView::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; | 2388 view_mode = ProfileChooserView::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT; |
| 2389 break; |
| 2390 case AVATAR_BUBBLE_MODE_SIGNIN: |
| 2391 view_mode = ProfileChooserView::BUBBLE_VIEW_MODE_GAIA_SIGNIN; |
| 2392 break; |
| 2393 case AVATAR_BUBBLE_MODE_REAUTH: |
| 2394 view_mode = ProfileChooserView::BUBBLE_VIEW_MODE_GAIA_REAUTH; |
| 2395 break; |
| 2396 default: |
| 2397 view_mode = ProfileChooserView::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; |
| 2398 break; |
| 2399 } |
| 2400 |
| 2389 ProfileChooserView::ShowBubble( | 2401 ProfileChooserView::ShowBubble( |
| 2390 view_mode, button, views::BubbleBorder::TOP_RIGHT, | 2402 view_mode, button, views::BubbleBorder::TOP_RIGHT, |
| 2391 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, bounds, browser()); | 2403 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, bounds, browser()); |
| 2392 } | 2404 } |
| 2393 } else { | 2405 } else { |
| 2394 views::BubbleBorder::Arrow arrow = views::BubbleBorder::TOP_RIGHT; | 2406 views::BubbleBorder::Arrow arrow = views::BubbleBorder::TOP_RIGHT; |
| 2395 views::View* anchor_view = frame_->GetAvatarMenuButton(); | 2407 views::View* anchor_view = frame_->GetAvatarMenuButton(); |
| 2396 if (!anchor_view) | 2408 if (!anchor_view) |
| 2397 anchor_view = toolbar_->app_menu(); | 2409 anchor_view = toolbar_->app_menu(); |
| 2398 else if (!frame_->GetAvatarMenuButton()->button_on_right()) | 2410 else if (!frame_->GetAvatarMenuButton()->button_on_right()) |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2533 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2545 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
| 2534 gfx::Point icon_bottom( | 2546 gfx::Point icon_bottom( |
| 2535 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2547 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
| 2536 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2548 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
| 2537 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2549 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
| 2538 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2550 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
| 2539 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2551 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
| 2540 } | 2552 } |
| 2541 return top_arrow_height; | 2553 return top_arrow_height; |
| 2542 } | 2554 } |
| OLD | NEW |