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

Side by Side Diff: chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm

Issue 297123002: API proposal for chrome.app.window to intercept all keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to TOT Created 6 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/cocoa/apps/native_app_window_cocoa.h" 5 #include "chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/mac/foundation_util.h" 8 #include "base/mac/foundation_util.h"
9 #include "base/mac/mac_util.h" 9 #include "base/mac/mac_util.h"
10 #include "base/mac/sdk_forward_declarations.h" 10 #include "base/mac/sdk_forward_declarations.h"
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 975
976 void NativeAppWindowCocoa::SetAlwaysOnTop(bool always_on_top) { 976 void NativeAppWindowCocoa::SetAlwaysOnTop(bool always_on_top) {
977 [window() setLevel:(always_on_top ? AlwaysOnTopWindowLevel() : 977 [window() setLevel:(always_on_top ? AlwaysOnTopWindowLevel() :
978 NSNormalWindowLevel)]; 978 NSNormalWindowLevel)];
979 } 979 }
980 980
981 void NativeAppWindowCocoa::SetVisibleOnAllWorkspaces(bool always_visible) { 981 void NativeAppWindowCocoa::SetVisibleOnAllWorkspaces(bool always_visible) {
982 SetWorkspacesCollectionBehavior(window(), always_visible); 982 SetWorkspacesCollectionBehavior(window(), always_visible);
983 } 983 }
984 984
985 void NativeAppWindowCocoa::SetInterceptAllKeys(bool want_all_key) {
986 // TODO(sriramsr): implement for OSX (http://crbug.com/166928).
987 NOTIMPLEMENTED();
988 }
989
985 NativeAppWindowCocoa::~NativeAppWindowCocoa() { 990 NativeAppWindowCocoa::~NativeAppWindowCocoa() {
986 } 991 }
987 992
988 ShellNSWindow* NativeAppWindowCocoa::window() const { 993 ShellNSWindow* NativeAppWindowCocoa::window() const {
989 NSWindow* window = [window_controller_ window]; 994 NSWindow* window = [window_controller_ window];
990 CHECK(!window || [window isKindOfClass:[ShellNSWindow class]]); 995 CHECK(!window || [window isKindOfClass:[ShellNSWindow class]]);
991 return static_cast<ShellNSWindow*>(window); 996 return static_cast<ShellNSWindow*>(window);
992 } 997 }
993 998
994 content::WebContents* NativeAppWindowCocoa::WebContents() const { 999 content::WebContents* NativeAppWindowCocoa::WebContents() const {
995 return app_window_->web_contents(); 1000 return app_window_->web_contents();
996 } 1001 }
997 1002
998 void NativeAppWindowCocoa::UpdateRestoredBounds() { 1003 void NativeAppWindowCocoa::UpdateRestoredBounds() {
999 if (IsRestored(*this)) 1004 if (IsRestored(*this))
1000 restored_bounds_ = [window() frame]; 1005 restored_bounds_ = [window() frame];
1001 } 1006 }
1002 1007
1003 void NativeAppWindowCocoa::HideWithoutMarkingHidden() { 1008 void NativeAppWindowCocoa::HideWithoutMarkingHidden() {
1004 [window() orderOut:window_controller_]; 1009 [window() orderOut:window_controller_];
1005 } 1010 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h ('k') | chrome/browser/ui/views/apps/chrome_native_app_window_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698