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

Side by Side Diff: chrome/browser/cocoa/tab_contents_controller.mm

Issue 126294: Mac fullscreen mode (with pkasting). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/cocoa/tab_contents_controller.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/cocoa/tab_contents_controller.h" 5 #import "chrome/browser/cocoa/tab_contents_controller.h"
6 6
7 #include "base/mac_util.h" 7 #include "base/mac_util.h"
8 #include "base/sys_string_conversions.h" 8 #include "base/sys_string_conversions.h"
9 #include "chrome/browser/bookmarks/bookmark_model.h" 9 #include "chrome/browser/bookmarks/bookmark_model.h"
10 #include "chrome/browser/tab_contents/tab_contents.h" 10 #include "chrome/browser/tab_contents/tab_contents.h"
(...skipping 19 matching lines...) Expand all
30 [contentsBox_ setContentView:contents_->GetNativeView()]; 30 [contentsBox_ setContentView:contents_->GetNativeView()];
31 } 31 }
32 32
33 // Returns YES if the tab represented by this controller is the front-most. 33 // Returns YES if the tab represented by this controller is the front-most.
34 - (BOOL)isCurrentTab { 34 - (BOOL)isCurrentTab {
35 // We're the current tab if we're in the view hierarchy, otherwise some other 35 // We're the current tab if we're in the view hierarchy, otherwise some other
36 // tab is. 36 // tab is.
37 return [[self view] superview] ? YES : NO; 37 return [[self view] superview] ? YES : NO;
38 } 38 }
39 39
40 - (IBAction)fullScreen:(id)sender {
41 if ([[self view] isInFullScreenMode]) {
42 [[self view] exitFullScreenModeWithOptions:nil];
43 } else {
44 [[self view] enterFullScreenMode:[NSScreen mainScreen] withOptions:nil];
45 }
46 }
47
48 - (void)willBecomeSelectedTab { 40 - (void)willBecomeSelectedTab {
49 } 41 }
50 42
51 - (void)tabDidChange:(TabContents*)updatedContents { 43 - (void)tabDidChange:(TabContents*)updatedContents {
52 // Calling setContentView: here removes any first responder status 44 // Calling setContentView: here removes any first responder status
53 // the view may have, so avoid changing the view hierarchy unless 45 // the view may have, so avoid changing the view hierarchy unless
54 // the view is different. 46 // the view is different.
55 if (contents_ != updatedContents) { 47 if (contents_ != updatedContents) {
56 contents_ = updatedContents; 48 contents_ = updatedContents;
57 [contentsBox_ setContentView:contents_->GetNativeView()]; 49 [contentsBox_ setContentView:contents_->GetNativeView()];
58 } 50 }
59 } 51 }
60 52
61 @end 53 @end
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/tab_contents_controller.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698