| 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 1927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1938 | 1938 |
| 1939 void BrowserView::Layout() { | 1939 void BrowserView::Layout() { |
| 1940 if (!initialized_ || in_process_fullscreen_) | 1940 if (!initialized_ || in_process_fullscreen_) |
| 1941 return; | 1941 return; |
| 1942 | 1942 |
| 1943 views::View::Layout(); | 1943 views::View::Layout(); |
| 1944 | 1944 |
| 1945 // TODO(jamescook): Why was this in the middle of layout code? | 1945 // TODO(jamescook): Why was this in the middle of layout code? |
| 1946 toolbar_->location_bar()->omnibox_view()->SetFocusBehavior( | 1946 toolbar_->location_bar()->omnibox_view()->SetFocusBehavior( |
| 1947 IsToolbarVisible() ? FocusBehavior::ALWAYS : FocusBehavior::NEVER); | 1947 IsToolbarVisible() ? FocusBehavior::ALWAYS : FocusBehavior::NEVER); |
| 1948 frame()->GetFrameView()->UpdateMinimumSize(); |
| 1948 } | 1949 } |
| 1949 | 1950 |
| 1950 void BrowserView::OnGestureEvent(ui::GestureEvent* event) { | 1951 void BrowserView::OnGestureEvent(ui::GestureEvent* event) { |
| 1951 int command; | 1952 int command; |
| 1952 if (GetGestureCommand(event, &command) && | 1953 if (GetGestureCommand(event, &command) && |
| 1953 chrome::IsCommandEnabled(browser(), command)) { | 1954 chrome::IsCommandEnabled(browser(), command)) { |
| 1954 chrome::ExecuteCommandWithDisposition( | 1955 chrome::ExecuteCommandWithDisposition( |
| 1955 browser(), command, ui::DispositionFromEventFlags(event->flags())); | 1956 browser(), command, ui::DispositionFromEventFlags(event->flags())); |
| 1956 return; | 1957 return; |
| 1957 } | 1958 } |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2133 // Create a custom JumpList and add it to an observer of TabRestoreService | 2134 // Create a custom JumpList and add it to an observer of TabRestoreService |
| 2134 // so we can update the custom JumpList when a tab is added or removed. | 2135 // so we can update the custom JumpList when a tab is added or removed. |
| 2135 if (JumpList::Enabled()) { | 2136 if (JumpList::Enabled()) { |
| 2136 load_complete_listener_.reset(new LoadCompleteListener(this)); | 2137 load_complete_listener_.reset(new LoadCompleteListener(this)); |
| 2137 } | 2138 } |
| 2138 #endif | 2139 #endif |
| 2139 | 2140 |
| 2140 GetLocationBar()->GetOmniboxView()->model()->popup_model()->AddObserver(this); | 2141 GetLocationBar()->GetOmniboxView()->model()->popup_model()->AddObserver(this); |
| 2141 | 2142 |
| 2142 frame_->OnBrowserViewInitViewsComplete(); | 2143 frame_->OnBrowserViewInitViewsComplete(); |
| 2144 frame_->GetFrameView()->UpdateMinimumSize(); |
| 2143 } | 2145 } |
| 2144 | 2146 |
| 2145 void BrowserView::LoadingAnimationCallback() { | 2147 void BrowserView::LoadingAnimationCallback() { |
| 2146 if (browser_->is_type_tabbed()) { | 2148 if (browser_->is_type_tabbed()) { |
| 2147 // Loading animations are shown in the tab for tabbed windows. We check the | 2149 // Loading animations are shown in the tab for tabbed windows. We check the |
| 2148 // browser type instead of calling IsTabStripVisible() because the latter | 2150 // browser type instead of calling IsTabStripVisible() because the latter |
| 2149 // will return false for fullscreen windows, but we still need to update | 2151 // will return false for fullscreen windows, but we still need to update |
| 2150 // their animations (so that when they come out of fullscreen mode they'll | 2152 // their animations (so that when they come out of fullscreen mode they'll |
| 2151 // be correct). | 2153 // be correct). |
| 2152 tabstrip_->UpdateLoadingAnimations(); | 2154 tabstrip_->UpdateLoadingAnimations(); |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2666 } | 2668 } |
| 2667 | 2669 |
| 2668 extensions::ActiveTabPermissionGranter* | 2670 extensions::ActiveTabPermissionGranter* |
| 2669 BrowserView::GetActiveTabPermissionGranter() { | 2671 BrowserView::GetActiveTabPermissionGranter() { |
| 2670 content::WebContents* web_contents = GetActiveWebContents(); | 2672 content::WebContents* web_contents = GetActiveWebContents(); |
| 2671 if (!web_contents) | 2673 if (!web_contents) |
| 2672 return nullptr; | 2674 return nullptr; |
| 2673 return extensions::TabHelper::FromWebContents(web_contents) | 2675 return extensions::TabHelper::FromWebContents(web_contents) |
| 2674 ->active_tab_permission_granter(); | 2676 ->active_tab_permission_granter(); |
| 2675 } | 2677 } |
| OLD | NEW |