OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.h" |
6 | 6 |
7 #include "base/mac/mac_util.h" | 7 #include "base/mac/mac_util.h" |
8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/cocoa/browser_window_utils.h" | 10 #include "chrome/browser/ui/cocoa/browser_window_utils.h" |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 [NSApp cancelUserAttentionRequest:attention_request_id_]; | 647 [NSApp cancelUserAttentionRequest:attention_request_id_]; |
648 attention_request_id_ = 0; | 648 attention_request_id_ = 0; |
649 } | 649 } |
650 } | 650 } |
651 | 651 |
652 bool NativeAppWindowCocoa::IsAlwaysOnTop() const { | 652 bool NativeAppWindowCocoa::IsAlwaysOnTop() const { |
653 return false; | 653 return false; |
654 } | 654 } |
655 | 655 |
656 void NativeAppWindowCocoa::RenderViewHostChanged() { | 656 void NativeAppWindowCocoa::RenderViewHostChanged() { |
657 web_contents()->Focus(); | 657 web_contents()->GetView()->Focus(); |
658 } | 658 } |
659 | 659 |
660 gfx::Insets NativeAppWindowCocoa::GetFrameInsets() const { | 660 gfx::Insets NativeAppWindowCocoa::GetFrameInsets() const { |
661 if (!has_frame_) | 661 if (!has_frame_) |
662 return gfx::Insets(); | 662 return gfx::Insets(); |
663 | 663 |
664 // Flip the coordinates based on the main screen. | 664 // Flip the coordinates based on the main screen. |
665 NSInteger screen_height = | 665 NSInteger screen_height = |
666 NSHeight([[[NSScreen screens] objectAtIndex:0] frame]); | 666 NSHeight([[[NSScreen screens] objectAtIndex:0] frame]); |
667 | 667 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 CHECK(!window || [window isKindOfClass:[ShellNSWindow class]]); | 758 CHECK(!window || [window isKindOfClass:[ShellNSWindow class]]); |
759 return static_cast<ShellNSWindow*>(window); | 759 return static_cast<ShellNSWindow*>(window); |
760 } | 760 } |
761 | 761 |
762 // static | 762 // static |
763 NativeAppWindow* NativeAppWindow::Create( | 763 NativeAppWindow* NativeAppWindow::Create( |
764 ShellWindow* shell_window, | 764 ShellWindow* shell_window, |
765 const ShellWindow::CreateParams& params) { | 765 const ShellWindow::CreateParams& params) { |
766 return new NativeAppWindowCocoa(shell_window, params); | 766 return new NativeAppWindowCocoa(shell_window, params); |
767 } | 767 } |
OLD | NEW |