| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |