| 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 24 matching lines...) Expand all Loading... |
| 35 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" | 35 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" |
| 36 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" | 36 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" |
| 37 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" | 37 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
| 38 #include "chrome/browser/ui/browser.h" | 38 #include "chrome/browser/ui/browser.h" |
| 39 #include "chrome/browser/ui/browser_command_controller.h" | 39 #include "chrome/browser/ui/browser_command_controller.h" |
| 40 #include "chrome/browser/ui/browser_commands.h" | 40 #include "chrome/browser/ui/browser_commands.h" |
| 41 #include "chrome/browser/ui/browser_dialogs.h" | 41 #include "chrome/browser/ui/browser_dialogs.h" |
| 42 #include "chrome/browser/ui/browser_finder.h" | 42 #include "chrome/browser/ui/browser_finder.h" |
| 43 #include "chrome/browser/ui/browser_list.h" | 43 #include "chrome/browser/ui/browser_list.h" |
| 44 #include "chrome/browser/ui/browser_window_state.h" | 44 #include "chrome/browser/ui/browser_window_state.h" |
| 45 #include "chrome/browser/ui/immersive_fullscreen_configuration.h" |
| 45 #include "chrome/browser/ui/ntp_background_util.h" | 46 #include "chrome/browser/ui/ntp_background_util.h" |
| 46 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" | 47 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" |
| 47 #include "chrome/browser/ui/omnibox/omnibox_popup_view.h" | 48 #include "chrome/browser/ui/omnibox/omnibox_popup_view.h" |
| 48 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 49 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
| 49 #include "chrome/browser/ui/search/search_delegate.h" | 50 #include "chrome/browser/ui/search/search_delegate.h" |
| 50 #include "chrome/browser/ui/search/search_model.h" | 51 #include "chrome/browser/ui/search/search_model.h" |
| 51 #include "chrome/browser/ui/search/search_ui.h" | 52 #include "chrome/browser/ui/search/search_ui.h" |
| 52 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 53 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
| 53 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 54 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 54 #include "chrome/browser/ui/view_ids.h" | 55 #include "chrome/browser/ui/view_ids.h" |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 return false; | 246 return false; |
| 246 #endif | 247 #endif |
| 247 return true; | 248 return true; |
| 248 } | 249 } |
| 249 | 250 |
| 250 // Returns whether immersive mode should replace fullscreen, which should only | 251 // Returns whether immersive mode should replace fullscreen, which should only |
| 251 // occur for "browser-fullscreen" and not for "tab-fullscreen" (which has a URL | 252 // occur for "browser-fullscreen" and not for "tab-fullscreen" (which has a URL |
| 252 // for the tab entering fullscreen). | 253 // for the tab entering fullscreen). |
| 253 bool UseImmersiveFullscreenForUrl(const GURL& url) { | 254 bool UseImmersiveFullscreenForUrl(const GURL& url) { |
| 254 bool is_browser_fullscreen = url.is_empty(); | 255 bool is_browser_fullscreen = url.is_empty(); |
| 255 return is_browser_fullscreen && chrome::UseImmersiveFullscreen(); | 256 return is_browser_fullscreen && |
| 257 ImmersiveFullscreenConfiguration::UseImmersiveFullscreen(); |
| 256 } | 258 } |
| 257 | 259 |
| 258 } // namespace | 260 } // namespace |
| 259 | 261 |
| 260 /////////////////////////////////////////////////////////////////////////////// | 262 /////////////////////////////////////////////////////////////////////////////// |
| 261 | 263 |
| 262 // Delegate implementation for BrowserViewLayout. Usually just forwards calls | 264 // Delegate implementation for BrowserViewLayout. Usually just forwards calls |
| 263 // into BrowserView. | 265 // into BrowserView. |
| 264 class BrowserViewLayoutDelegateImpl : public BrowserViewLayoutDelegate { | 266 class BrowserViewLayoutDelegateImpl : public BrowserViewLayoutDelegate { |
| 265 public: | 267 public: |
| (...skipping 2492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2758 // The +1 in the next line creates a 1-px gap between icon and arrow tip. | 2760 // The +1 in the next line creates a 1-px gap between icon and arrow tip. |
| 2759 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - | 2761 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - |
| 2760 LocationBarView::kIconInternalPadding + 1); | 2762 LocationBarView::kIconInternalPadding + 1); |
| 2761 ConvertPointToTarget(location_icon_view, this, &icon_bottom); | 2763 ConvertPointToTarget(location_icon_view, this, &icon_bottom); |
| 2762 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2764 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
| 2763 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2765 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
| 2764 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2766 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
| 2765 } | 2767 } |
| 2766 return top_arrow_height; | 2768 return top_arrow_height; |
| 2767 } | 2769 } |
| OLD | NEW |