| 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/strings/sys_string_conversions.h" | 8 #include "base/strings/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 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 gfx::Rect frame_rect(NSRectToCGRect(frame_nsrect)); | 686 gfx::Rect frame_rect(NSRectToCGRect(frame_nsrect)); |
| 687 frame_rect.set_y(screen_height - NSMaxY(frame_nsrect)); | 687 frame_rect.set_y(screen_height - NSMaxY(frame_nsrect)); |
| 688 | 688 |
| 689 NSRect content_nsrect = [window() contentRectForFrameRect:frame_nsrect]; | 689 NSRect content_nsrect = [window() contentRectForFrameRect:frame_nsrect]; |
| 690 gfx::Rect content_rect(NSRectToCGRect(content_nsrect)); | 690 gfx::Rect content_rect(NSRectToCGRect(content_nsrect)); |
| 691 content_rect.set_y(screen_height - NSMaxY(content_nsrect)); | 691 content_rect.set_y(screen_height - NSMaxY(content_nsrect)); |
| 692 | 692 |
| 693 return frame_rect.InsetsFrom(content_rect); | 693 return frame_rect.InsetsFrom(content_rect); |
| 694 } | 694 } |
| 695 | 695 |
| 696 gfx::Point NativeAppWindowCocoa::GetDialogPosition(const gfx::Size& size) { |
| 697 NOTIMPLEMENTED(); |
| 698 return gfx::Point(); |
| 699 } |
| 700 |
| 701 void NativeAppWindowCocoa::AddObserver( |
| 702 WebContentsModalDialogHostObserver* observer) { |
| 703 NOTIMPLEMENTED(); |
| 704 } |
| 705 |
| 706 void NativeAppWindowCocoa::RemoveObserver( |
| 707 WebContentsModalDialogHostObserver* observer) { |
| 708 NOTIMPLEMENTED(); |
| 709 } |
| 710 |
| 696 void NativeAppWindowCocoa::WindowWillClose() { | 711 void NativeAppWindowCocoa::WindowWillClose() { |
| 697 [window_controller_ setAppWindow:NULL]; | 712 [window_controller_ setAppWindow:NULL]; |
| 698 shell_window_->OnNativeWindowChanged(); | 713 shell_window_->OnNativeWindowChanged(); |
| 699 shell_window_->OnNativeClose(); | 714 shell_window_->OnNativeClose(); |
| 700 } | 715 } |
| 701 | 716 |
| 702 void NativeAppWindowCocoa::WindowDidBecomeKey() { | 717 void NativeAppWindowCocoa::WindowDidBecomeKey() { |
| 703 content::RenderWidgetHostView* rwhv = | 718 content::RenderWidgetHostView* rwhv = |
| 704 web_contents()->GetRenderWidgetHostView(); | 719 web_contents()->GetRenderWidgetHostView(); |
| 705 if (rwhv) | 720 if (rwhv) |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 CHECK(!window || [window isKindOfClass:[ShellNSWindow class]]); | 790 CHECK(!window || [window isKindOfClass:[ShellNSWindow class]]); |
| 776 return static_cast<ShellNSWindow*>(window); | 791 return static_cast<ShellNSWindow*>(window); |
| 777 } | 792 } |
| 778 | 793 |
| 779 // static | 794 // static |
| 780 NativeAppWindow* NativeAppWindow::Create( | 795 NativeAppWindow* NativeAppWindow::Create( |
| 781 ShellWindow* shell_window, | 796 ShellWindow* shell_window, |
| 782 const ShellWindow::CreateParams& params) { | 797 const ShellWindow::CreateParams& params) { |
| 783 return new NativeAppWindowCocoa(shell_window, params); | 798 return new NativeAppWindowCocoa(shell_window, params); |
| 784 } | 799 } |
| OLD | NEW |