Chromium Code Reviews| 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 2222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2233 // recompute the height of the infobar top arrow because toggling in and out | 2233 // recompute the height of the infobar top arrow because toggling in and out |
| 2234 // of fullscreen changes it. Calling ToolbarSizeChanged() will do both these | 2234 // of fullscreen changes it. Calling ToolbarSizeChanged() will do both these |
| 2235 // things since it computes the arrow height directly and forces a layout | 2235 // things since it computes the arrow height directly and forces a layout |
| 2236 // indirectly via UpdateUIForContents(). Reset |in_process_fullscreen_| in | 2236 // indirectly via UpdateUIForContents(). Reset |in_process_fullscreen_| in |
| 2237 // order to let the layout occur. | 2237 // order to let the layout occur. |
| 2238 in_process_fullscreen_ = false; | 2238 in_process_fullscreen_ = false; |
| 2239 ToolbarSizeChanged(false); | 2239 ToolbarSizeChanged(false); |
| 2240 } | 2240 } |
| 2241 | 2241 |
| 2242 bool BrowserView::ShouldUseImmersiveFullscreenForUrl(const GURL& url) const { | 2242 bool BrowserView::ShouldUseImmersiveFullscreenForUrl(const GURL& url) const { |
| 2243 #if defined(OS_CHROMEOS) | 2243 #if defined(OS_CHROMEOS) |
|
pkotwicz
2014/03/13 18:08:45
Kiosk mode is actually not CrOS only. switches::kK
| |
| 2244 // Kiosk mode needs the whole screen. | 2244 // Kiosk mode needs the whole screen. |
| 2245 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) | 2245 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) |
| 2246 return false; | 2246 return false; |
| 2247 #else | |
| 2247 bool is_browser_fullscreen = url.is_empty(); | 2248 bool is_browser_fullscreen = url.is_empty(); |
|
sky
2014/03/13 15:55:09
Shouldn't this depend upon the hostdesktype?
zturner
2014/03/13 16:15:59
Perhaps so, in any case I should probably test mor
| |
| 2248 if (ash::switches::UseImmersiveFullscreenForAllWindows()) | 2249 if (ash::switches::UseImmersiveFullscreenForAllWindows()) |
| 2249 return is_browser_fullscreen; | 2250 return is_browser_fullscreen; |
| 2250 else | 2251 else |
| 2251 return is_browser_fullscreen && IsBrowserTypeNormal(); | 2252 return is_browser_fullscreen && IsBrowserTypeNormal(); |
| 2252 #else | |
| 2253 return false; | |
| 2254 #endif | 2253 #endif |
| 2255 } | 2254 } |
| 2256 | 2255 |
| 2257 void BrowserView::LoadAccelerators() { | 2256 void BrowserView::LoadAccelerators() { |
| 2258 views::FocusManager* focus_manager = GetFocusManager(); | 2257 views::FocusManager* focus_manager = GetFocusManager(); |
| 2259 DCHECK(focus_manager); | 2258 DCHECK(focus_manager); |
| 2260 | 2259 |
| 2261 // Let's fill our own accelerator table. | 2260 // Let's fill our own accelerator table. |
| 2262 const bool is_app_mode = chrome::IsRunningInForcedAppMode(); | 2261 const bool is_app_mode = chrome::IsRunningInForcedAppMode(); |
| 2263 const std::vector<chrome::AcceleratorMapping> accelerator_list( | 2262 const std::vector<chrome::AcceleratorMapping> accelerator_list( |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2577 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2576 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
| 2578 gfx::Point icon_bottom( | 2577 gfx::Point icon_bottom( |
| 2579 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2578 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
| 2580 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2579 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
| 2581 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2580 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
| 2582 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2581 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
| 2583 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2582 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
| 2584 } | 2583 } |
| 2585 return top_arrow_height; | 2584 return top_arrow_height; |
| 2586 } | 2585 } |
| OLD | NEW |