| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #if defined(TOOLKIT_USES_GTK) | 7 #if defined(TOOLKIT_USES_GTK) |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 1607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1618 window_rect.set_origin(bounds->origin()); | 1618 window_rect.set_origin(bounds->origin()); |
| 1619 | 1619 |
| 1620 // When we are given x/y coordinates of 0 on a created popup window, | 1620 // When we are given x/y coordinates of 0 on a created popup window, |
| 1621 // assume none were given by the window.open() command. | 1621 // assume none were given by the window.open() command. |
| 1622 if (window_rect.x() == 0 && window_rect.y() == 0) { | 1622 if (window_rect.x() == 0 && window_rect.y() == 0) { |
| 1623 gfx::Size size = window_rect.size(); | 1623 gfx::Size size = window_rect.size(); |
| 1624 window_rect.set_origin(WindowSizer::GetDefaultPopupOrigin(size)); | 1624 window_rect.set_origin(WindowSizer::GetDefaultPopupOrigin(size)); |
| 1625 } | 1625 } |
| 1626 | 1626 |
| 1627 *bounds = window_rect; | 1627 *bounds = window_rect; |
| 1628 *show_state = ui::SHOW_STATE_NORMAL; |
| 1628 } | 1629 } |
| 1629 | 1630 |
| 1630 // We return true because we can _always_ locate reasonable bounds using the | 1631 // We return true because we can _always_ locate reasonable bounds using the |
| 1631 // WindowSizer, and we don't want to trigger the Window's built-in "size to | 1632 // WindowSizer, and we don't want to trigger the Window's built-in "size to |
| 1632 // default" handling because the browser window has no default preferred | 1633 // default" handling because the browser window has no default preferred |
| 1633 // size. | 1634 // size. |
| 1634 return true; | 1635 return true; |
| 1635 } | 1636 } |
| 1636 | 1637 |
| 1637 views::View* BrowserView::GetContentsView() { | 1638 views::View* BrowserView::GetContentsView() { |
| (...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2639 browser::CreateViewsBubble(bubble); | 2640 browser::CreateViewsBubble(bubble); |
| 2640 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 2641 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
| 2641 bubble->Show(); | 2642 bubble->Show(); |
| 2642 } | 2643 } |
| 2643 | 2644 |
| 2644 void BrowserView::ShowAvatarBubbleFromAvatarButton() { | 2645 void BrowserView::ShowAvatarBubbleFromAvatarButton() { |
| 2645 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); | 2646 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); |
| 2646 if (button) | 2647 if (button) |
| 2647 button->ShowAvatarBubble(); | 2648 button->ShowAvatarBubble(); |
| 2648 } | 2649 } |
| OLD | NEW |