| 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 2529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2540 } | 2540 } |
| 2541 | 2541 |
| 2542 void BrowserView::ShowAvatarBubbleFromAvatarButton() { | 2542 void BrowserView::ShowAvatarBubbleFromAvatarButton() { |
| 2543 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); | 2543 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); |
| 2544 if (button) | 2544 if (button) |
| 2545 button->ShowAvatarBubble(); | 2545 button->ShowAvatarBubble(); |
| 2546 } | 2546 } |
| 2547 | 2547 |
| 2548 void BrowserView::ShowPasswordGenerationBubble( | 2548 void BrowserView::ShowPasswordGenerationBubble( |
| 2549 const gfx::Rect& rect, | 2549 const gfx::Rect& rect, |
| 2550 const content::PasswordForm& form, | 2550 const autofill::PasswordForm& form, |
| 2551 autofill::PasswordGenerator* password_generator) { | 2551 autofill::PasswordGenerator* password_generator) { |
| 2552 // Create a rect in the content bounds that the bubble will point to. | 2552 // Create a rect in the content bounds that the bubble will point to. |
| 2553 gfx::Point origin(rect.origin()); | 2553 gfx::Point origin(rect.origin()); |
| 2554 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); | 2554 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); |
| 2555 gfx::Rect bounds(origin, rect.size()); | 2555 gfx::Rect bounds(origin, rect.size()); |
| 2556 | 2556 |
| 2557 // Create the bubble. | 2557 // Create the bubble. |
| 2558 WebContents* web_contents = GetActiveWebContents(); | 2558 WebContents* web_contents = GetActiveWebContents(); |
| 2559 if (!web_contents) | 2559 if (!web_contents) |
| 2560 return; | 2560 return; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2674 // The +1 in the next line creates a 1-px gap between icon and arrow tip. | 2674 // The +1 in the next line creates a 1-px gap between icon and arrow tip. |
| 2675 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - | 2675 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - |
| 2676 LocationBarView::kIconInternalPadding + 1); | 2676 LocationBarView::kIconInternalPadding + 1); |
| 2677 ConvertPointToTarget(location_icon_view, this, &icon_bottom); | 2677 ConvertPointToTarget(location_icon_view, this, &icon_bottom); |
| 2678 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2678 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
| 2679 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2679 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
| 2680 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2680 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
| 2681 } | 2681 } |
| 2682 return top_arrow_height; | 2682 return top_arrow_height; |
| 2683 } | 2683 } |
| OLD | NEW |