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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
102 #include "ui/gfx/sys_color_change_listener.h" | 102 #include "ui/gfx/sys_color_change_listener.h" |
103 #include "ui/ui_controls/ui_controls.h" | 103 #include "ui/ui_controls/ui_controls.h" |
104 #include "ui/views/controls/single_split_view.h" | 104 #include "ui/views/controls/single_split_view.h" |
105 #include "ui/views/controls/webview/webview.h" | 105 #include "ui/views/controls/webview/webview.h" |
106 #include "ui/views/focus/external_focus_tracker.h" | 106 #include "ui/views/focus/external_focus_tracker.h" |
107 #include "ui/views/focus/view_storage.h" | 107 #include "ui/views/focus/view_storage.h" |
108 #include "ui/views/layout/grid_layout.h" | 108 #include "ui/views/layout/grid_layout.h" |
109 #include "ui/views/widget/native_widget.h" | 109 #include "ui/views/widget/native_widget.h" |
110 #include "ui/views/widget/root_view.h" | 110 #include "ui/views/widget/root_view.h" |
111 #include "ui/views/widget/widget.h" | 111 #include "ui/views/widget/widget.h" |
112 #include "ui/views/win/scoped_fullscreen_visibility.h" | |
sky
2012/08/22 19:13:47
Should this be around line 127?
| |
112 #include "ui/views/window/dialog_delegate.h" | 113 #include "ui/views/window/dialog_delegate.h" |
113 | 114 |
114 #if defined(USE_ASH) | 115 #if defined(USE_ASH) |
115 #include "ash/launcher/launcher.h" | 116 #include "ash/launcher/launcher.h" |
116 #include "ash/launcher/launcher_model.h" | 117 #include "ash/launcher/launcher_model.h" |
117 #include "ash/shell.h" | 118 #include "ash/shell.h" |
118 #include "chrome/browser/ui/ash/ash_util.h" | 119 #include "chrome/browser/ui/ash/ash_util.h" |
119 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" | 120 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
120 #include "chrome/browser/ui/ash/launcher/browser_launcher_item_controller.h" | 121 #include "chrome/browser/ui/ash/launcher/browser_launcher_item_controller.h" |
121 #include "chrome/browser/ui/ash/window_positioner.h" | 122 #include "chrome/browser/ui/ash/window_positioner.h" |
(...skipping 2102 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 |