| 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 2437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2448 void BrowserView::ShowAvatarBubbleFromAvatarButton() { | 2448 void BrowserView::ShowAvatarBubbleFromAvatarButton() { |
| 2449 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); | 2449 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); |
| 2450 if (button) | 2450 if (button) |
| 2451 button->ShowAvatarBubble(); | 2451 button->ShowAvatarBubble(); |
| 2452 } | 2452 } |
| 2453 | 2453 |
| 2454 void BrowserView::ShowPasswordGenerationBubble( | 2454 void BrowserView::ShowPasswordGenerationBubble( |
| 2455 const gfx::Rect& rect, | 2455 const gfx::Rect& rect, |
| 2456 autofill::PasswordGenerator* password_generator, | 2456 autofill::PasswordGenerator* password_generator, |
| 2457 const webkit::forms::PasswordForm& form) { | 2457 const webkit::forms::PasswordForm& form) { |
| 2458 ui::ThemeProvider* theme_provider = GetWidget()->GetThemeProvider(); |
| 2459 |
| 2458 // Create a rect in the content bounds that the bubble will point to. | 2460 // Create a rect in the content bounds that the bubble will point to. |
| 2459 gfx::Point origin(rect.origin()); | 2461 gfx::Point origin(rect.origin()); |
| 2460 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); | 2462 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); |
| 2461 gfx::Rect bounds(origin, rect.size()); | 2463 gfx::Rect bounds(origin, rect.size()); |
| 2462 | 2464 |
| 2463 // Create the bubble. | 2465 // Create the bubble. |
| 2464 TabContents* tab_contents = GetActiveTabContents(); | 2466 TabContents* tab_contents = GetActiveTabContents(); |
| 2465 if (!tab_contents) | 2467 if (!tab_contents) |
| 2466 return; | 2468 return; |
| 2467 | 2469 |
| 2468 PasswordGenerationBubbleView* bubble = | 2470 PasswordGenerationBubbleView* bubble = |
| 2469 new PasswordGenerationBubbleView( | 2471 new PasswordGenerationBubbleView( |
| 2470 bounds, | 2472 bounds, |
| 2471 form, | 2473 form, |
| 2472 this, | 2474 this, |
| 2473 tab_contents->web_contents()->GetRenderViewHost(), | 2475 tab_contents->web_contents()->GetRenderViewHost(), |
| 2474 password_generator, | 2476 password_generator, |
| 2475 browser_.get(), | 2477 browser_.get(), |
| 2476 tab_contents->password_manager()); | 2478 tab_contents->password_manager(), |
| 2479 theme_provider); |
| 2477 | 2480 |
| 2478 views::BubbleDelegateView::CreateBubble(bubble); | 2481 views::BubbleDelegateView::CreateBubble(bubble); |
| 2479 bubble->SetAlignment(views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR); | 2482 bubble->SetAlignment(views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR); |
| 2480 bubble->Show(); | 2483 bubble->Show(); |
| 2481 } | 2484 } |
| OLD | NEW |