| OLD | NEW |
| 1 // Copyright (c) 2011 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 #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 |
| 11 #include <algorithm> | 11 #include <algorithm> |
| (...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1639 window_rect.set_origin(bounds->origin()); | 1639 window_rect.set_origin(bounds->origin()); |
| 1640 | 1640 |
| 1641 // When we are given x/y coordinates of 0 on a created popup window, | 1641 // When we are given x/y coordinates of 0 on a created popup window, |
| 1642 // assume none were given by the window.open() command. | 1642 // assume none were given by the window.open() command. |
| 1643 if (window_rect.x() == 0 && window_rect.y() == 0) { | 1643 if (window_rect.x() == 0 && window_rect.y() == 0) { |
| 1644 gfx::Size size = window_rect.size(); | 1644 gfx::Size size = window_rect.size(); |
| 1645 window_rect.set_origin(WindowSizer::GetDefaultPopupOrigin(size)); | 1645 window_rect.set_origin(WindowSizer::GetDefaultPopupOrigin(size)); |
| 1646 } | 1646 } |
| 1647 | 1647 |
| 1648 *bounds = window_rect; | 1648 *bounds = window_rect; |
| 1649 *show_state = ui::SHOW_STATE_NORMAL; |
| 1649 } | 1650 } |
| 1650 | 1651 |
| 1651 // We return true because we can _always_ locate reasonable bounds using the | 1652 // We return true because we can _always_ locate reasonable bounds using the |
| 1652 // WindowSizer, and we don't want to trigger the Window's built-in "size to | 1653 // WindowSizer, and we don't want to trigger the Window's built-in "size to |
| 1653 // default" handling because the browser window has no default preferred | 1654 // default" handling because the browser window has no default preferred |
| 1654 // size. | 1655 // size. |
| 1655 return true; | 1656 return true; |
| 1656 } | 1657 } |
| 1657 | 1658 |
| 1658 views::View* BrowserView::GetContentsView() { | 1659 views::View* BrowserView::GetContentsView() { |
| (...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2657 browser::CreateViewsBubble(bubble); | 2658 browser::CreateViewsBubble(bubble); |
| 2658 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 2659 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
| 2659 bubble->Show(); | 2660 bubble->Show(); |
| 2660 } | 2661 } |
| 2661 | 2662 |
| 2662 void BrowserView::ShowAvatarBubbleFromAvatarButton() { | 2663 void BrowserView::ShowAvatarBubbleFromAvatarButton() { |
| 2663 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); | 2664 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); |
| 2664 if (button) | 2665 if (button) |
| 2665 button->ShowAvatarBubble(); | 2666 button->ShowAvatarBubble(); |
| 2666 } | 2667 } |
| OLD | NEW |