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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 for (std::vector<gfx::Rect>::const_iterator iter = | 629 for (std::vector<gfx::Rect>::const_iterator iter = |
630 system_drag_exclude_areas_.begin(); | 630 system_drag_exclude_areas_.begin(); |
631 iter != system_drag_exclude_areas_.end(); | 631 iter != system_drag_exclude_areas_.end(); |
632 ++iter) { | 632 ++iter) { |
633 scoped_nsobject<NSView> controlRegion( | 633 scoped_nsobject<NSView> controlRegion( |
634 [[ControlRegionView alloc] initWithAppWindow:this]); | 634 [[ControlRegionView alloc] initWithAppWindow:this]); |
635 [controlRegion setFrame:NSMakeRect(iter->x(), | 635 [controlRegion setFrame:NSMakeRect(iter->x(), |
636 webViewHeight - iter->bottom(), | 636 webViewHeight - iter->bottom(), |
637 iter->width(), | 637 iter->width(), |
638 iter->height())]; | 638 iter->height())]; |
| 639 [controlRegion setAutoresizingMask:NSViewWidthSizable|NSViewHeightSizable]; |
639 [webView addSubview:controlRegion]; | 640 [webView addSubview:controlRegion]; |
640 } | 641 } |
641 } | 642 } |
642 | 643 |
643 void NativeAppWindowCocoa::FlashFrame(bool flash) { | 644 void NativeAppWindowCocoa::FlashFrame(bool flash) { |
644 if (flash) { | 645 if (flash) { |
645 attention_request_id_ = [NSApp requestUserAttention:NSInformationalRequest]; | 646 attention_request_id_ = [NSApp requestUserAttention:NSInformationalRequest]; |
646 } else { | 647 } else { |
647 [NSApp cancelUserAttentionRequest:attention_request_id_]; | 648 [NSApp cancelUserAttentionRequest:attention_request_id_]; |
648 attention_request_id_ = 0; | 649 attention_request_id_ = 0; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 CHECK(!window || [window isKindOfClass:[ShellNSWindow class]]); | 759 CHECK(!window || [window isKindOfClass:[ShellNSWindow class]]); |
759 return static_cast<ShellNSWindow*>(window); | 760 return static_cast<ShellNSWindow*>(window); |
760 } | 761 } |
761 | 762 |
762 // static | 763 // static |
763 NativeAppWindow* NativeAppWindow::Create( | 764 NativeAppWindow* NativeAppWindow::Create( |
764 ShellWindow* shell_window, | 765 ShellWindow* shell_window, |
765 const ShellWindow::CreateParams& params) { | 766 const ShellWindow::CreateParams& params) { |
766 return new NativeAppWindowCocoa(shell_window, params); | 767 return new NativeAppWindowCocoa(shell_window, params); |
767 } | 768 } |
OLD | NEW |