| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 #include "ui/views/controls/webview/webview.h" | 125 #include "ui/views/controls/webview/webview.h" |
| 126 #include "ui/views/focus/external_focus_tracker.h" | 126 #include "ui/views/focus/external_focus_tracker.h" |
| 127 #include "ui/views/focus/view_storage.h" | 127 #include "ui/views/focus/view_storage.h" |
| 128 #include "ui/views/layout/grid_layout.h" | 128 #include "ui/views/layout/grid_layout.h" |
| 129 #include "ui/views/widget/native_widget.h" | 129 #include "ui/views/widget/native_widget.h" |
| 130 #include "ui/views/widget/root_view.h" | 130 #include "ui/views/widget/root_view.h" |
| 131 #include "ui/views/widget/widget.h" | 131 #include "ui/views/widget/widget.h" |
| 132 #include "ui/views/window/dialog_delegate.h" | 132 #include "ui/views/window/dialog_delegate.h" |
| 133 | 133 |
| 134 #if defined(USE_ASH) | 134 #if defined(USE_ASH) |
| 135 #include "ash/ash_switches.h" |
| 135 #include "ash/launcher/launcher.h" | 136 #include "ash/launcher/launcher.h" |
| 136 #include "ash/shelf/shelf_model.h" | 137 #include "ash/shelf/shelf_model.h" |
| 137 #include "ash/shell.h" | 138 #include "ash/shell.h" |
| 138 #include "chrome/browser/ui/ash/ash_util.h" | 139 #include "chrome/browser/ui/ash/ash_util.h" |
| 139 #endif | 140 #endif |
| 140 | 141 |
| 141 #if defined(USE_AURA) | 142 #if defined(USE_AURA) |
| 142 #include "ui/aura/window.h" | 143 #include "ui/aura/window.h" |
| 143 #include "ui/gfx/screen.h" | 144 #include "ui/gfx/screen.h" |
| 144 #elif defined(OS_WIN) // !defined(USE_AURA) | 145 #elif defined(OS_WIN) // !defined(USE_AURA) |
| (...skipping 2169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2314 in_process_fullscreen_ = false; | 2315 in_process_fullscreen_ = false; |
| 2315 ToolbarSizeChanged(false); | 2316 ToolbarSizeChanged(false); |
| 2316 } | 2317 } |
| 2317 | 2318 |
| 2318 bool BrowserView::ShouldUseImmersiveFullscreenForUrl(const GURL& url) const { | 2319 bool BrowserView::ShouldUseImmersiveFullscreenForUrl(const GURL& url) const { |
| 2319 #if defined(OS_CHROMEOS) | 2320 #if defined(OS_CHROMEOS) |
| 2320 // Kiosk mode needs the whole screen. | 2321 // Kiosk mode needs the whole screen. |
| 2321 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) | 2322 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) |
| 2322 return false; | 2323 return false; |
| 2323 bool is_browser_fullscreen = url.is_empty(); | 2324 bool is_browser_fullscreen = url.is_empty(); |
| 2324 return is_browser_fullscreen && IsBrowserTypeNormal(); | 2325 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 2326 ash::switches::kAshEnableImmersiveFullscreenForAllWindows)) { |
| 2327 return is_browser_fullscreen; |
| 2328 } else { |
| 2329 return is_browser_fullscreen && IsBrowserTypeNormal(); |
| 2330 } |
| 2325 #else | 2331 #else |
| 2326 return false; | 2332 return false; |
| 2327 #endif | 2333 #endif |
| 2328 } | 2334 } |
| 2329 | 2335 |
| 2330 void BrowserView::LoadAccelerators() { | 2336 void BrowserView::LoadAccelerators() { |
| 2331 #if defined(OS_WIN) && !defined(USE_AURA) | 2337 #if defined(OS_WIN) && !defined(USE_AURA) |
| 2332 HACCEL accelerator_table = AtlLoadAccelerators(IDR_MAINFRAME); | 2338 HACCEL accelerator_table = AtlLoadAccelerators(IDR_MAINFRAME); |
| 2333 DCHECK(accelerator_table); | 2339 DCHECK(accelerator_table); |
| 2334 | 2340 |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2660 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2666 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
| 2661 gfx::Point icon_bottom( | 2667 gfx::Point icon_bottom( |
| 2662 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2668 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
| 2663 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2669 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
| 2664 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2670 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
| 2665 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2671 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
| 2666 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2672 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
| 2667 } | 2673 } |
| 2668 return top_arrow_height; | 2674 return top_arrow_height; |
| 2669 } | 2675 } |
| OLD | NEW |