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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 #include "ash/shell.h" | 117 #include "ash/shell.h" |
118 #include "chrome/browser/ui/ash/ash_util.h" | 118 #include "chrome/browser/ui/ash/ash_util.h" |
119 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" | 119 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
120 #include "chrome/browser/ui/ash/launcher/browser_launcher_item_controller.h" | 120 #include "chrome/browser/ui/ash/launcher/browser_launcher_item_controller.h" |
121 #include "chrome/browser/ui/ash/window_positioner.h" | 121 #include "chrome/browser/ui/ash/window_positioner.h" |
122 #elif defined(OS_WIN) && !defined(USE_AURA) | 122 #elif defined(OS_WIN) && !defined(USE_AURA) |
123 #include "base/win/metro.h" | 123 #include "base/win/metro.h" |
124 #include "chrome/browser/jumplist_win.h" | 124 #include "chrome/browser/jumplist_win.h" |
125 #include "chrome/browser/ui/views/omnibox/omnibox_view_win.h" | 125 #include "chrome/browser/ui/views/omnibox/omnibox_view_win.h" |
126 #include "ui/views/widget/native_widget_win.h" | 126 #include "ui/views/widget/native_widget_win.h" |
| 127 #include "ui/views/win/scoped_fullscreen_visibility.h" |
127 #endif | 128 #endif |
128 | 129 |
129 #if defined(USE_AURA) | 130 #if defined(USE_AURA) |
130 #include "chrome/browser/ui/views/accelerator_table.h" | 131 #include "chrome/browser/ui/views/accelerator_table.h" |
131 #include "chrome/browser/ui/views/search_view_controller.h" | 132 #include "chrome/browser/ui/views/search_view_controller.h" |
132 #include "chrome/browser/ui/webui/task_manager/task_manager_dialog.h" | 133 #include "chrome/browser/ui/webui/task_manager/task_manager_dialog.h" |
133 #include "ui/aura/window.h" | 134 #include "ui/aura/window.h" |
134 #include "ui/gfx/screen.h" | 135 #include "ui/gfx/screen.h" |
135 #endif | 136 #endif |
136 | 137 |
(...skipping 2087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2224 // fullscreen, then if the user was on the New Tab Page, the edit contents | 2225 // fullscreen, then if the user was on the New Tab Page, the edit contents |
2225 // will appear atop the web contents once we go into fullscreen mode. This | 2226 // will appear atop the web contents once we go into fullscreen mode. This |
2226 // has something to do with how we move the main window while it's hidden; | 2227 // has something to do with how we move the main window while it's hidden; |
2227 // if we don't hide the main window below, we don't get this problem. | 2228 // if we don't hide the main window below, we don't get this problem. |
2228 omnibox_win->set_force_hidden(true); | 2229 omnibox_win->set_force_hidden(true); |
2229 ShowWindow(omnibox_win->m_hWnd, SW_HIDE); | 2230 ShowWindow(omnibox_win->m_hWnd, SW_HIDE); |
2230 } | 2231 } |
2231 #endif | 2232 #endif |
2232 } | 2233 } |
2233 #if defined(OS_WIN) && !defined(USE_AURA) | 2234 #if defined(OS_WIN) && !defined(USE_AURA) |
2234 static_cast<views::NativeWidgetWin*>(frame_->native_widget())-> | 2235 views::ScopedFullscreenVisibility visibility(frame_->GetNativeView()); |
2235 PushForceHidden(); | |
2236 #endif | 2236 #endif |
2237 | 2237 |
2238 if (type == FOR_METRO) { | 2238 if (type == FOR_METRO) { |
2239 #if defined(OS_WIN) && !defined(USE_AURA) | 2239 #if defined(OS_WIN) && !defined(USE_AURA) |
2240 // Enter metro snap mode. | 2240 // Enter metro snap mode. |
2241 static_cast<views::NativeWidgetWin*>( | 2241 static_cast<views::NativeWidgetWin*>( |
2242 frame_->native_widget())->SetMetroSnapFullscreen(fullscreen); | 2242 frame_->native_widget())->SetMetroSnapFullscreen(fullscreen); |
2243 #endif | 2243 #endif |
2244 } else { | 2244 } else { |
2245 // Toggle fullscreen mode. | 2245 // Toggle fullscreen mode. |
(...skipping 16 matching lines...) Expand all Loading... |
2262 omnibox_win->set_force_hidden(false); | 2262 omnibox_win->set_force_hidden(false); |
2263 ShowWindow(omnibox_win->m_hWnd, SW_SHOW); | 2263 ShowWindow(omnibox_win->m_hWnd, SW_SHOW); |
2264 } | 2264 } |
2265 #endif | 2265 #endif |
2266 } | 2266 } |
2267 | 2267 |
2268 // Undo our anti-jankiness hacks and force the window to re-layout now that | 2268 // Undo our anti-jankiness hacks and force the window to re-layout now that |
2269 // it's in its final position. | 2269 // it's in its final position. |
2270 ignore_layout_ = false; | 2270 ignore_layout_ = false; |
2271 Layout(); | 2271 Layout(); |
2272 #if defined(OS_WIN) && !defined(USE_AURA) | |
2273 static_cast<views::NativeWidgetWin*>(frame_->native_widget())-> | |
2274 PopForceHidden(); | |
2275 #endif | |
2276 } | 2272 } |
2277 | 2273 |
2278 void BrowserView::LoadAccelerators() { | 2274 void BrowserView::LoadAccelerators() { |
2279 #if defined(OS_WIN) && !defined(USE_AURA) | 2275 #if defined(OS_WIN) && !defined(USE_AURA) |
2280 HACCEL accelerator_table = AtlLoadAccelerators(IDR_MAINFRAME); | 2276 HACCEL accelerator_table = AtlLoadAccelerators(IDR_MAINFRAME); |
2281 DCHECK(accelerator_table); | 2277 DCHECK(accelerator_table); |
2282 | 2278 |
2283 // We have to copy the table to access its contents. | 2279 // We have to copy the table to access its contents. |
2284 int count = CopyAcceleratorTable(accelerator_table, 0, 0); | 2280 int count = CopyAcceleratorTable(accelerator_table, 0, 0); |
2285 if (count == 0) { | 2281 if (count == 0) { |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2598 | 2594 |
2599 Browser* modal_browser = | 2595 Browser* modal_browser = |
2600 browser::FindBrowserWithWebContents(active_dialog->web_contents()); | 2596 browser::FindBrowserWithWebContents(active_dialog->web_contents()); |
2601 if (modal_browser && (browser_ != modal_browser)) { | 2597 if (modal_browser && (browser_ != modal_browser)) { |
2602 modal_browser->window()->FlashFrame(true); | 2598 modal_browser->window()->FlashFrame(true); |
2603 modal_browser->window()->Activate(); | 2599 modal_browser->window()->Activate(); |
2604 } | 2600 } |
2605 | 2601 |
2606 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); | 2602 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); |
2607 } | 2603 } |
OLD | NEW |