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 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 ExclusiveAccessBubbleType bubble_type) { | 952 ExclusiveAccessBubbleType bubble_type) { |
952 // Immersive mode has no exit bubble because it has a visible strip at the | 953 // Immersive mode has no exit bubble because it has a visible strip at the |
953 // top that gives the user a hover target. | 954 // top that gives the user a hover target. |
954 // TODO(jamescook): Figure out what to do with mouse-lock. | 955 // TODO(jamescook): Figure out what to do with mouse-lock. |
955 if (bubble_type == EXCLUSIVE_ACCESS_BUBBLE_TYPE_NONE || | 956 if (bubble_type == EXCLUSIVE_ACCESS_BUBBLE_TYPE_NONE || |
956 ShouldUseImmersiveFullscreenForUrl(url)) { | 957 ShouldUseImmersiveFullscreenForUrl(url)) { |
957 exclusive_access_bubble_.reset(); | 958 exclusive_access_bubble_.reset(); |
958 } else if (exclusive_access_bubble_.get()) { | 959 } else if (exclusive_access_bubble_.get()) { |
959 exclusive_access_bubble_->UpdateContent(url, bubble_type); | 960 exclusive_access_bubble_->UpdateContent(url, bubble_type); |
960 } else { | 961 } else { |
961 exclusive_access_bubble_.reset( | 962 // TODO(sriramsr): HACK LEAKS memeory - might want to merge with this clas. |
962 new ExclusiveAccessBubbleViews(this, url, bubble_type)); | 963 exclusive_access_bubble_.reset(new ExclusiveAccessBubbleViews( |
| 964 new ExclusiveAccessBubbleViewsContextBrowser(this), url, bubble_type)); |
963 } | 965 } |
964 } | 966 } |
965 | 967 |
966 bool BrowserView::ShouldHideUIForFullscreen() const { | 968 bool BrowserView::ShouldHideUIForFullscreen() const { |
967 // Immersive mode needs UI for the slide-down top panel. | 969 // Immersive mode needs UI for the slide-down top panel. |
968 if (immersive_mode_controller_->IsEnabled()) | 970 if (immersive_mode_controller_->IsEnabled()) |
969 return false; | 971 return false; |
970 | 972 |
971 return IsFullscreen(); | 973 return IsFullscreen(); |
972 } | 974 } |
(...skipping 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2561 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2563 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
2562 gfx::Point icon_bottom( | 2564 gfx::Point icon_bottom( |
2563 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2565 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
2564 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2566 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
2565 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(nullptr)); | 2567 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(nullptr)); |
2566 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2568 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
2567 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2569 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
2568 } | 2570 } |
2569 return top_arrow_height; | 2571 return top_arrow_height; |
2570 } | 2572 } |
OLD | NEW |