OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 2385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2396 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 2396 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
2397 bubble->Show(); | 2397 bubble->Show(); |
2398 } | 2398 } |
2399 | 2399 |
2400 void BrowserView::ShowAvatarBubbleFromAvatarButton() { | 2400 void BrowserView::ShowAvatarBubbleFromAvatarButton() { |
2401 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); | 2401 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); |
2402 if (button) | 2402 if (button) |
2403 button->ShowAvatarBubble(); | 2403 button->ShowAvatarBubble(); |
2404 } | 2404 } |
2405 | 2405 |
2406 void BrowserView::ShowPasswordGenerationBubble(const gfx::Rect& rect) { | 2406 void BrowserView::ShowPasswordGenerationBubble( |
| 2407 const gfx::Rect& rect, |
| 2408 const autofill::PasswordGenerator& password_generator) { |
2407 // Create a rect in the content bounds that the bubble will point to. | 2409 // Create a rect in the content bounds that the bubble will point to. |
2408 gfx::Point origin(rect.origin()); | 2410 gfx::Point origin(rect.origin()); |
2409 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); | 2411 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); |
2410 gfx::Rect bounds(origin, rect.size()); | 2412 gfx::Rect bounds(origin, rect.size()); |
2411 | 2413 |
2412 // Create the bubble. | 2414 // Create the bubble. |
2413 WebContents* web_contents = GetSelectedWebContents(); | 2415 WebContents* web_contents = GetSelectedWebContents(); |
2414 if (!web_contents) | 2416 if (!web_contents) |
2415 return; | 2417 return; |
2416 | 2418 |
2417 PasswordGenerationBubbleView* bubble = | 2419 PasswordGenerationBubbleView* bubble = |
2418 new PasswordGenerationBubbleView(bounds, | 2420 new PasswordGenerationBubbleView(bounds, |
2419 this, | 2421 this, |
2420 web_contents->GetRenderViewHost()); | 2422 web_contents->GetRenderViewHost(), |
| 2423 password_generator); |
2421 views::BubbleDelegateView::CreateBubble(bubble); | 2424 views::BubbleDelegateView::CreateBubble(bubble); |
2422 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 2425 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
2423 bubble->Show(); | 2426 bubble->Show(); |
2424 } | 2427 } |
OLD | NEW |