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

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: Update based on sky's comments Created 6 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 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 "apps/app_shim/extension_app_shim_handler_mac.h" 7 #include "apps/app_shim/extension_app_shim_handler_mac.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/mac/foundation_util.h" 9 #include "base/mac/foundation_util.h"
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 [[window() standardWindowButton:NSWindowZoomButton] 987 [[window() standardWindowButton:NSWindowZoomButton]
988 setEnabled:shows_fullscreen_controls_]; 988 setEnabled:shows_fullscreen_controls_];
989 } 989 }
990 } 990 }
991 991
992 void NativeAppWindowCocoa::SetAlwaysOnTop(bool always_on_top) { 992 void NativeAppWindowCocoa::SetAlwaysOnTop(bool always_on_top) {
993 [window() setLevel:(always_on_top ? AlwaysOnTopWindowLevel() : 993 [window() setLevel:(always_on_top ? AlwaysOnTopWindowLevel() :
994 NSNormalWindowLevel)]; 994 NSNormalWindowLevel)];
995 } 995 }
996 996
997 void NativeAppWindowCocoa::SetInterceptAllKeys(bool want_all_key) {
998 // TODO(sriramsr): implement
benwells 2014/08/01 00:32:43 Please add a bug link to the TODO.
Sriram 2014/08/11 21:01:28 Done.
999 NOTIMPLEMENTED();
1000 }
1001
997 NativeAppWindowCocoa::~NativeAppWindowCocoa() { 1002 NativeAppWindowCocoa::~NativeAppWindowCocoa() {
998 } 1003 }
999 1004
1000 ShellNSWindow* NativeAppWindowCocoa::window() const { 1005 ShellNSWindow* NativeAppWindowCocoa::window() const {
1001 NSWindow* window = [window_controller_ window]; 1006 NSWindow* window = [window_controller_ window];
1002 CHECK(!window || [window isKindOfClass:[ShellNSWindow class]]); 1007 CHECK(!window || [window isKindOfClass:[ShellNSWindow class]]);
1003 return static_cast<ShellNSWindow*>(window); 1008 return static_cast<ShellNSWindow*>(window);
1004 } 1009 }
1005 1010
1006 content::WebContents* NativeAppWindowCocoa::WebContents() const { 1011 content::WebContents* NativeAppWindowCocoa::WebContents() const {
1007 return app_window_->web_contents(); 1012 return app_window_->web_contents();
1008 } 1013 }
1009 1014
1010 void NativeAppWindowCocoa::UpdateRestoredBounds() { 1015 void NativeAppWindowCocoa::UpdateRestoredBounds() {
1011 if (IsRestored(*this)) 1016 if (IsRestored(*this))
1012 restored_bounds_ = [window() frame]; 1017 restored_bounds_ = [window() frame];
1013 } 1018 }
1014 1019
1015 void NativeAppWindowCocoa::HideWithoutMarkingHidden() { 1020 void NativeAppWindowCocoa::HideWithoutMarkingHidden() {
1016 [window() orderOut:window_controller_]; 1021 [window() orderOut:window_controller_];
1017 } 1022 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698