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 2389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2400 } | 2400 } |
2401 | 2401 |
2402 void BrowserView::ShowAvatarBubbleFromAvatarButton() { | 2402 void BrowserView::ShowAvatarBubbleFromAvatarButton() { |
2403 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); | 2403 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); |
2404 if (button) | 2404 if (button) |
2405 button->ShowAvatarBubble(); | 2405 button->ShowAvatarBubble(); |
2406 } | 2406 } |
2407 | 2407 |
2408 void BrowserView::ShowPasswordGenerationBubble( | 2408 void BrowserView::ShowPasswordGenerationBubble( |
2409 const gfx::Rect& rect, | 2409 const gfx::Rect& rect, |
| 2410 autofill::PasswordGenerator* password_generator, |
2410 const webkit::forms::PasswordForm& form) { | 2411 const webkit::forms::PasswordForm& form) { |
2411 // Create a rect in the content bounds that the bubble will point to. | 2412 // Create a rect in the content bounds that the bubble will point to. |
2412 gfx::Point origin(rect.origin()); | 2413 gfx::Point origin(rect.origin()); |
2413 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); | 2414 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); |
2414 gfx::Rect bounds(origin, rect.size()); | 2415 gfx::Rect bounds(origin, rect.size()); |
2415 | 2416 |
2416 // Create the bubble. | 2417 // Create the bubble. |
2417 WebContents* web_contents = GetSelectedWebContents(); | 2418 WebContents* web_contents = GetSelectedWebContents(); |
2418 TabContentsWrapper* wrapper = GetSelectedTabContentsWrapper(); | 2419 TabContentsWrapper* wrapper = GetSelectedTabContentsWrapper(); |
2419 if (!web_contents || !wrapper) | 2420 if (!web_contents || !wrapper) |
2420 return; | 2421 return; |
2421 | 2422 |
2422 PasswordGenerationBubbleView* bubble = | 2423 PasswordGenerationBubbleView* bubble = |
2423 new PasswordGenerationBubbleView(bounds, | 2424 new PasswordGenerationBubbleView(bounds, |
2424 form, | 2425 form, |
2425 this, | 2426 this, |
2426 web_contents->GetRenderViewHost(), | 2427 web_contents->GetRenderViewHost(), |
| 2428 password_generator, |
2427 browser_.get(), | 2429 browser_.get(), |
2428 wrapper->password_manager()); | 2430 wrapper->password_manager()); |
2429 | 2431 |
2430 views::BubbleDelegateView::CreateBubble(bubble); | 2432 views::BubbleDelegateView::CreateBubble(bubble); |
2431 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 2433 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
2432 bubble->Show(); | 2434 bubble->Show(); |
2433 } | 2435 } |
OLD | NEW |