| 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 2469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2480 void BrowserView::ShowAvatarBubbleFromAvatarButton() { | 2480 void BrowserView::ShowAvatarBubbleFromAvatarButton() { |
| 2481 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); | 2481 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); |
| 2482 if (button) | 2482 if (button) |
| 2483 button->ShowAvatarBubble(); | 2483 button->ShowAvatarBubble(); |
| 2484 } | 2484 } |
| 2485 | 2485 |
| 2486 void BrowserView::ShowPasswordGenerationBubble( | 2486 void BrowserView::ShowPasswordGenerationBubble( |
| 2487 const gfx::Rect& rect, | 2487 const gfx::Rect& rect, |
| 2488 autofill::PasswordGenerator* password_generator, | 2488 autofill::PasswordGenerator* password_generator, |
| 2489 const webkit::forms::PasswordForm& form) { | 2489 const webkit::forms::PasswordForm& form) { |
| 2490 ui::ThemeProvider* theme_provider = GetWidget()->GetThemeProvider(); |
| 2491 |
| 2490 // Create a rect in the content bounds that the bubble will point to. | 2492 // Create a rect in the content bounds that the bubble will point to. |
| 2491 gfx::Point origin(rect.origin()); | 2493 gfx::Point origin(rect.origin()); |
| 2492 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); | 2494 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); |
| 2493 gfx::Rect bounds(origin, rect.size()); | 2495 gfx::Rect bounds(origin, rect.size()); |
| 2494 | 2496 |
| 2495 // Create the bubble. | 2497 // Create the bubble. |
| 2496 TabContents* tab_contents = GetActiveTabContents(); | 2498 TabContents* tab_contents = GetActiveTabContents(); |
| 2497 if (!tab_contents) | 2499 if (!tab_contents) |
| 2498 return; | 2500 return; |
| 2499 | 2501 |
| 2500 PasswordGenerationBubbleView* bubble = | 2502 PasswordGenerationBubbleView* bubble = |
| 2501 new PasswordGenerationBubbleView( | 2503 new PasswordGenerationBubbleView( |
| 2502 bounds, | 2504 bounds, |
| 2503 form, | 2505 form, |
| 2504 this, | 2506 this, |
| 2505 tab_contents->web_contents()->GetRenderViewHost(), | 2507 tab_contents->web_contents()->GetRenderViewHost(), |
| 2506 password_generator, | 2508 password_generator, |
| 2507 browser_.get(), | 2509 browser_.get(), |
| 2508 tab_contents->password_manager()); | 2510 tab_contents->password_manager(), |
| 2511 theme_provider); |
| 2509 | 2512 |
| 2510 views::BubbleDelegateView::CreateBubble(bubble); | 2513 views::BubbleDelegateView::CreateBubble(bubble); |
| 2511 bubble->SetAlignment(views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR); | 2514 bubble->SetAlignment(views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR); |
| 2512 bubble->Show(); | 2515 bubble->Show(); |
| 2513 } | 2516 } |
| 2514 | 2517 |
| 2515 void BrowserView::RestackLocationBarContainer() { | 2518 void BrowserView::RestackLocationBarContainer() { |
| 2516 #if defined(USE_AURA) | 2519 #if defined(USE_AURA) |
| 2517 if (search_view_controller_.get()) | 2520 if (search_view_controller_.get()) |
| 2518 search_view_controller_->StackAtTop(); | 2521 search_view_controller_->StackAtTop(); |
| 2519 #endif | 2522 #endif |
| 2520 toolbar_->location_bar_container()->StackAtTop(); | 2523 toolbar_->location_bar_container()->StackAtTop(); |
| 2521 } | 2524 } |
| OLD | NEW |