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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 1916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1927 | 1927 |
1928 void BrowserView::Layout() { | 1928 void BrowserView::Layout() { |
1929 if (!initialized_ || in_process_fullscreen_) | 1929 if (!initialized_ || in_process_fullscreen_) |
1930 return; | 1930 return; |
1931 | 1931 |
1932 views::View::Layout(); | 1932 views::View::Layout(); |
1933 | 1933 |
1934 // TODO(jamescook): Why was this in the middle of layout code? | 1934 // TODO(jamescook): Why was this in the middle of layout code? |
1935 toolbar_->location_bar()->omnibox_view()->SetFocusBehavior( | 1935 toolbar_->location_bar()->omnibox_view()->SetFocusBehavior( |
1936 IsToolbarVisible() ? FocusBehavior::ALWAYS : FocusBehavior::NEVER); | 1936 IsToolbarVisible() ? FocusBehavior::ALWAYS : FocusBehavior::NEVER); |
| 1937 frame()->GetFrameView()->UpdateMinimumSize(); |
1937 } | 1938 } |
1938 | 1939 |
1939 void BrowserView::OnGestureEvent(ui::GestureEvent* event) { | 1940 void BrowserView::OnGestureEvent(ui::GestureEvent* event) { |
1940 int command; | 1941 int command; |
1941 if (GetGestureCommand(event, &command) && | 1942 if (GetGestureCommand(event, &command) && |
1942 chrome::IsCommandEnabled(browser(), command)) { | 1943 chrome::IsCommandEnabled(browser(), command)) { |
1943 chrome::ExecuteCommandWithDisposition( | 1944 chrome::ExecuteCommandWithDisposition( |
1944 browser(), command, ui::DispositionFromEventFlags(event->flags())); | 1945 browser(), command, ui::DispositionFromEventFlags(event->flags())); |
1945 return; | 1946 return; |
1946 } | 1947 } |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2122 // Create a custom JumpList and add it to an observer of TabRestoreService | 2123 // Create a custom JumpList and add it to an observer of TabRestoreService |
2123 // so we can update the custom JumpList when a tab is added or removed. | 2124 // so we can update the custom JumpList when a tab is added or removed. |
2124 if (JumpList::Enabled()) { | 2125 if (JumpList::Enabled()) { |
2125 load_complete_listener_.reset(new LoadCompleteListener(this)); | 2126 load_complete_listener_.reset(new LoadCompleteListener(this)); |
2126 } | 2127 } |
2127 #endif | 2128 #endif |
2128 | 2129 |
2129 GetLocationBar()->GetOmniboxView()->model()->popup_model()->AddObserver(this); | 2130 GetLocationBar()->GetOmniboxView()->model()->popup_model()->AddObserver(this); |
2130 | 2131 |
2131 frame_->OnBrowserViewInitViewsComplete(); | 2132 frame_->OnBrowserViewInitViewsComplete(); |
| 2133 frame_->GetFrameView()->UpdateMinimumSize(); |
2132 } | 2134 } |
2133 | 2135 |
2134 void BrowserView::LoadingAnimationCallback() { | 2136 void BrowserView::LoadingAnimationCallback() { |
2135 if (browser_->is_type_tabbed()) { | 2137 if (browser_->is_type_tabbed()) { |
2136 // Loading animations are shown in the tab for tabbed windows. We check the | 2138 // Loading animations are shown in the tab for tabbed windows. We check the |
2137 // browser type instead of calling IsTabStripVisible() because the latter | 2139 // browser type instead of calling IsTabStripVisible() because the latter |
2138 // will return false for fullscreen windows, but we still need to update | 2140 // will return false for fullscreen windows, but we still need to update |
2139 // their animations (so that when they come out of fullscreen mode they'll | 2141 // their animations (so that when they come out of fullscreen mode they'll |
2140 // be correct). | 2142 // be correct). |
2141 tabstrip_->UpdateLoadingAnimations(); | 2143 tabstrip_->UpdateLoadingAnimations(); |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2655 } | 2657 } |
2656 | 2658 |
2657 extensions::ActiveTabPermissionGranter* | 2659 extensions::ActiveTabPermissionGranter* |
2658 BrowserView::GetActiveTabPermissionGranter() { | 2660 BrowserView::GetActiveTabPermissionGranter() { |
2659 content::WebContents* web_contents = GetActiveWebContents(); | 2661 content::WebContents* web_contents = GetActiveWebContents(); |
2660 if (!web_contents) | 2662 if (!web_contents) |
2661 return nullptr; | 2663 return nullptr; |
2662 return extensions::TabHelper::FromWebContents(web_contents) | 2664 return extensions::TabHelper::FromWebContents(web_contents) |
2663 ->active_tab_permission_granter(); | 2665 ->active_tab_permission_granter(); |
2664 } | 2666 } |
OLD | NEW |