| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 57 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 58 #include "chrome/browser/ui/view_ids.h" | 58 #include "chrome/browser/ui/view_ids.h" |
| 59 #include "chrome/browser/ui/views/accelerator_table.h" | 59 #include "chrome/browser/ui/views/accelerator_table.h" |
| 60 #include "chrome/browser/ui/views/accessibility/invert_bubble_view.h" | 60 #include "chrome/browser/ui/views/accessibility/invert_bubble_view.h" |
| 61 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" | 61 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" |
| 62 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" | 62 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" |
| 63 #include "chrome/browser/ui/views/browser_dialogs.h" | 63 #include "chrome/browser/ui/views/browser_dialogs.h" |
| 64 #include "chrome/browser/ui/views/download/download_in_progress_dialog_view.h" | 64 #include "chrome/browser/ui/views/download/download_in_progress_dialog_view.h" |
| 65 #include "chrome/browser/ui/views/download/download_shelf_view.h" | 65 #include "chrome/browser/ui/views/download/download_shelf_view.h" |
| 66 #include "chrome/browser/ui/views/exclusive_access_bubble_views.h" | 66 #include "chrome/browser/ui/views/exclusive_access_bubble_views.h" |
| 67 #include "chrome/browser/ui/views/exclusive_access_bubble_views_context_browser.
h" |
| 67 #include "chrome/browser/ui/views/extensions/bookmark_app_bubble_view.h" | 68 #include "chrome/browser/ui/views/extensions/bookmark_app_bubble_view.h" |
| 68 #include "chrome/browser/ui/views/frame/browser_view_layout.h" | 69 #include "chrome/browser/ui/views/frame/browser_view_layout.h" |
| 69 #include "chrome/browser/ui/views/frame/browser_view_layout_delegate.h" | 70 #include "chrome/browser/ui/views/frame/browser_view_layout_delegate.h" |
| 70 #include "chrome/browser/ui/views/frame/contents_layout_manager.h" | 71 #include "chrome/browser/ui/views/frame/contents_layout_manager.h" |
| 71 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" | 72 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" |
| 72 #include "chrome/browser/ui/views/frame/top_container_view.h" | 73 #include "chrome/browser/ui/views/frame/top_container_view.h" |
| 73 #include "chrome/browser/ui/views/frame/web_contents_close_handler.h" | 74 #include "chrome/browser/ui/views/frame/web_contents_close_handler.h" |
| 74 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" | 75 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" |
| 75 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 76 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 76 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" | 77 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" |
| (...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 ExclusiveAccessBubbleType bubble_type) { | 950 ExclusiveAccessBubbleType bubble_type) { |
| 950 // Immersive mode has no exit bubble because it has a visible strip at the | 951 // Immersive mode has no exit bubble because it has a visible strip at the |
| 951 // top that gives the user a hover target. | 952 // top that gives the user a hover target. |
| 952 // TODO(jamescook): Figure out what to do with mouse-lock. | 953 // TODO(jamescook): Figure out what to do with mouse-lock. |
| 953 if (bubble_type == EXCLUSIVE_ACCESS_BUBBLE_TYPE_NONE || | 954 if (bubble_type == EXCLUSIVE_ACCESS_BUBBLE_TYPE_NONE || |
| 954 ShouldUseImmersiveFullscreenForUrl(url)) { | 955 ShouldUseImmersiveFullscreenForUrl(url)) { |
| 955 exclusive_access_bubble_.reset(); | 956 exclusive_access_bubble_.reset(); |
| 956 } else if (exclusive_access_bubble_.get()) { | 957 } else if (exclusive_access_bubble_.get()) { |
| 957 exclusive_access_bubble_->UpdateContent(url, bubble_type); | 958 exclusive_access_bubble_->UpdateContent(url, bubble_type); |
| 958 } else { | 959 } else { |
| 960 scoped_ptr<ExclusiveAccessBubbleViewsContextBrowser> context( |
| 961 new ExclusiveAccessBubbleViewsContextBrowser(this)); |
| 959 exclusive_access_bubble_.reset( | 962 exclusive_access_bubble_.reset( |
| 960 new ExclusiveAccessBubbleViews(this, url, bubble_type)); | 963 new ExclusiveAccessBubbleViews(context.Pass(), url, bubble_type)); |
| 961 } | 964 } |
| 962 } | 965 } |
| 963 | 966 |
| 964 bool BrowserView::ShouldHideUIForFullscreen() const { | 967 bool BrowserView::ShouldHideUIForFullscreen() const { |
| 965 // Immersive mode needs UI for the slide-down top panel. | 968 // Immersive mode needs UI for the slide-down top panel. |
| 966 if (immersive_mode_controller_->IsEnabled()) | 969 if (immersive_mode_controller_->IsEnabled()) |
| 967 return false; | 970 return false; |
| 968 | 971 |
| 969 return IsFullscreen(); | 972 return IsFullscreen(); |
| 970 } | 973 } |
| (...skipping 1599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2570 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2573 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
| 2571 gfx::Point icon_bottom( | 2574 gfx::Point icon_bottom( |
| 2572 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2575 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
| 2573 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2576 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
| 2574 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(nullptr)); | 2577 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(nullptr)); |
| 2575 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2578 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
| 2576 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2579 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
| 2577 } | 2580 } |
| 2578 return top_arrow_height; | 2581 return top_arrow_height; |
| 2579 } | 2582 } |
| OLD | NEW |