Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(873)

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_controller.mm

Issue 1276383004: Implemented fullscreen exit animation with AppKit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactored the code to log UMA metrics Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <numeric> 8 #include <numeric>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1932 matching lines...) Expand 10 before | Expand all | Expand 10 after
1943 if (WebContents* contents = [self webContents]) { 1943 if (WebContents* contents = [self webContents]) {
1944 if (RenderWidgetHostView* rwhv = contents->GetRenderWidgetHostView()) 1944 if (RenderWidgetHostView* rwhv = contents->GetRenderWidgetHostView())
1945 rwhv->WindowFrameChanged(); 1945 rwhv->WindowFrameChanged();
1946 } 1946 }
1947 1947
1948 // The FindBar needs to know its own position to properly detect overlaps 1948 // The FindBar needs to know its own position to properly detect overlaps
1949 // with find results. The position changes whenever the window is resized, 1949 // with find results. The position changes whenever the window is resized,
1950 // and |layoutSubviews| computes the FindBar's position. 1950 // and |layoutSubviews| computes the FindBar's position.
1951 // TODO: calling |layoutSubviews| here is a waste, find a better way to 1951 // TODO: calling |layoutSubviews| here is a waste, find a better way to
1952 // do this. 1952 // do this.
1953
erikchen 2015/08/11 22:42:54 why did you add whitespace here?
spqchan1 2015/08/12 19:34:41 Done.
1953 if ([findBarCocoaController_ isFindBarVisible]) 1954 if ([findBarCocoaController_ isFindBarVisible])
1954 [self layoutSubviews]; 1955 [self layoutSubviews];
1955 } 1956 }
1956 1957
1957 // Handle the openLearnMoreAboutCrashLink: action from SadTabView when 1958 // Handle the openLearnMoreAboutCrashLink: action from SadTabView when
1958 // "Learn more" link in "Aw snap" page (i.e. crash page or sad tab) is 1959 // "Learn more" link in "Aw snap" page (i.e. crash page or sad tab) is
1959 // clicked. Decoupling the action from its target makes unit testing possible. 1960 // clicked. Decoupling the action from its target makes unit testing possible.
1960 - (void)openLearnMoreAboutCrashLink:(id)sender { 1961 - (void)openLearnMoreAboutCrashLink:(id)sender {
1961 if (WebContents* contents = [self webContents]) { 1962 if (WebContents* contents = [self webContents]) {
1962 OpenURLParams params(GURL(chrome::kCrashReasonURL), Referrer(), CURRENT_TAB, 1963 OpenURLParams params(GURL(chrome::kCrashReasonURL), Referrer(), CURRENT_TAB,
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
2144 2145
2145 - (BOOL)isInAnyFullscreenMode { 2146 - (BOOL)isInAnyFullscreenMode {
2146 return [self isInImmersiveFullscreen] || [self isInAppKitFullscreen]; 2147 return [self isInImmersiveFullscreen] || [self isInAppKitFullscreen];
2147 } 2148 }
2148 2149
2149 - (BOOL)isInImmersiveFullscreen { 2150 - (BOOL)isInImmersiveFullscreen {
2150 return fullscreenWindow_.get() != nil || enteringImmersiveFullscreen_; 2151 return fullscreenWindow_.get() != nil || enteringImmersiveFullscreen_;
2151 } 2152 }
2152 2153
2153 - (BOOL)isInAppKitFullscreen { 2154 - (BOOL)isInAppKitFullscreen {
2154 return ([[self window] styleMask] & NSFullScreenWindowMask) == 2155 return !exitingAppKitFullscreen_ &&
2155 NSFullScreenWindowMask || 2156 (([[self window] styleMask] & NSFullScreenWindowMask) ==
2156 enteringAppKitFullscreen_; 2157 NSFullScreenWindowMask ||
2158 enteringAppKitFullscreen_);
2157 } 2159 }
2158 2160
2159 - (void)enterExtensionFullscreenForURL:(const GURL&)url 2161 - (void)enterExtensionFullscreenForURL:(const GURL&)url
2160 bubbleType:(ExclusiveAccessBubbleType)bubbleType { 2162 bubbleType:(ExclusiveAccessBubbleType)bubbleType {
2161 if (chrome::mac::SupportsSystemFullscreen()) { 2163 if (chrome::mac::SupportsSystemFullscreen()) {
2162 fullscreenUrl_ = url; 2164 fullscreenUrl_ = url;
2163 exclusiveAccessBubbleType_ = bubbleType; 2165 exclusiveAccessBubbleType_ = bubbleType;
2164 [self enterBrowserFullscreenWithToolbar:NO]; 2166 [self enterBrowserFullscreenWithToolbar:NO];
2165 } else { 2167 } else {
2166 [self enterImmersiveFullscreen]; 2168 [self enterImmersiveFullscreen];
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
2266 2268
2267 - (BOOL)supportsBookmarkBar { 2269 - (BOOL)supportsBookmarkBar {
2268 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; 2270 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR];
2269 } 2271 }
2270 2272
2271 - (BOOL)isTabbedWindow { 2273 - (BOOL)isTabbedWindow {
2272 return browser_->is_type_tabbed(); 2274 return browser_->is_type_tabbed();
2273 } 2275 }
2274 2276
2275 @end // @implementation BrowserWindowController(WindowType) 2277 @end // @implementation BrowserWindowController(WindowType)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698