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 2098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2109 // * Hiding the window until it's in the final position | 2109 // * Hiding the window until it's in the final position |
2110 // * Ignoring all intervening Layout() calls, which resize the webpage and | 2110 // * Ignoring all intervening Layout() calls, which resize the webpage and |
2111 // thus are slow and look ugly | 2111 // thus are slow and look ugly |
2112 ignore_layout_ = true; | 2112 ignore_layout_ = true; |
2113 LocationBarView* location_bar = GetLocationBarView(); | 2113 LocationBarView* location_bar = GetLocationBarView(); |
2114 #if defined(OS_WIN) && !defined(USE_AURA) | 2114 #if defined(OS_WIN) && !defined(USE_AURA) |
2115 OmniboxViewWin* omnibox_view = | 2115 OmniboxViewWin* omnibox_view = |
2116 static_cast<OmniboxViewWin*>(location_bar->GetLocationEntry()); | 2116 static_cast<OmniboxViewWin*>(location_bar->GetLocationEntry()); |
2117 #endif | 2117 #endif |
2118 | 2118 |
2119 if (!fullscreen && type != FOR_METRO) { | 2119 if (type == FOR_METRO || !fullscreen) { |
2120 // Hide the fullscreen bubble as soon as possible, since the mode toggle can | 2120 // Hide the fullscreen bubble as soon as possible, since the mode toggle can |
2121 // take enough time for the user to notice. | 2121 // take enough time for the user to notice. |
2122 fullscreen_bubble_.reset(); | 2122 fullscreen_bubble_.reset(); |
2123 } else { | 2123 } |
| 2124 |
| 2125 if (fullscreen) { |
2124 // Move focus out of the location bar if necessary. | 2126 // Move focus out of the location bar if necessary. |
2125 views::FocusManager* focus_manager = GetFocusManager(); | 2127 views::FocusManager* focus_manager = GetFocusManager(); |
2126 DCHECK(focus_manager); | 2128 DCHECK(focus_manager); |
2127 // Look for focus in the location bar itself or any child view. | 2129 // Look for focus in the location bar itself or any child view. |
2128 if (location_bar->Contains(focus_manager->GetFocusedView())) | 2130 if (location_bar->Contains(focus_manager->GetFocusedView())) |
2129 focus_manager->ClearFocus(); | 2131 focus_manager->ClearFocus(); |
2130 | 2132 |
2131 #if defined(OS_WIN) && !defined(USE_AURA) | 2133 #if defined(OS_WIN) && !defined(USE_AURA) |
2132 // If we don't hide the edit and force it to not show until we come out of | 2134 // If we don't hide the edit and force it to not show until we come out of |
2133 // fullscreen, then if the user was on the New Tab Page, the edit contents | 2135 // fullscreen, then if the user was on the New Tab Page, the edit contents |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2473 this, | 2475 this, |
2474 tab_contents->web_contents()->GetRenderViewHost(), | 2476 tab_contents->web_contents()->GetRenderViewHost(), |
2475 password_generator, | 2477 password_generator, |
2476 browser_.get(), | 2478 browser_.get(), |
2477 tab_contents->password_manager()); | 2479 tab_contents->password_manager()); |
2478 | 2480 |
2479 views::BubbleDelegateView::CreateBubble(bubble); | 2481 views::BubbleDelegateView::CreateBubble(bubble); |
2480 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 2482 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
2481 bubble->Show(); | 2483 bubble->Show(); |
2482 } | 2484 } |
OLD | NEW |