Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <QuartzCore/QuartzCore.h> | 5 #include <QuartzCore/QuartzCore.h> |
| 6 | 6 |
| 7 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" | 7 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" |
| 8 | 8 |
| 9 #include "app/app_switches.h" | 9 #include "app/app_switches.h" |
| 10 #include "app/surface/io_surface_support_mac.h" | 10 #include "app/surface/io_surface_support_mac.h" |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 612 // in a TabContentsViewCocoa, they're both BaseViews. | 612 // in a TabContentsViewCocoa, they're both BaseViews. |
| 613 DCHECK([[cocoa_view_ superview] isKindOfClass:[BaseView class]]); | 613 DCHECK([[cocoa_view_ superview] isKindOfClass:[BaseView class]]); |
| 614 gfx::Rect rect = | 614 gfx::Rect rect = |
| 615 [(BaseView*)[cocoa_view_ superview] flipNSRectToRect:[cocoa_view_ frame]]; | 615 [(BaseView*)[cocoa_view_ superview] flipNSRectToRect:[cocoa_view_ frame]]; |
| 616 rect.set_width(size.width()); | 616 rect.set_width(size.width()); |
| 617 rect.set_height(size.height()); | 617 rect.set_height(size.height()); |
| 618 [cocoa_view_ setFrame: | 618 [cocoa_view_ setFrame: |
| 619 [(BaseView*)[cocoa_view_ superview] flipRectToNSRect:rect]]; | 619 [(BaseView*)[cocoa_view_ superview] flipRectToNSRect:rect]]; |
| 620 } | 620 } |
| 621 | 621 |
| 622 void RenderWidgetHostViewMac::MoveTo(const gfx::Point& point) { | |
| 623 if (is_hidden_) | |
| 624 return; | |
| 625 | |
| 626 // Do conversions to upper-left origin, as "move to" means keep the | |
| 627 // upper-left corner pinned. | |
|
Avi (use Gerrit)
2011/01/25 22:52:07
You can't really say "pinned" here as that implies
| |
| 628 DCHECK([[cocoa_view_ superview] isKindOfClass:[BaseView class]]); | |
| 629 gfx::Rect rect = | |
| 630 [(BaseView*)[cocoa_view_ superview] flipNSRectToRect:[cocoa_view_ frame]]; | |
| 631 rect.set_x(point.x()); | |
| 632 rect.set_y(point.y()); | |
| 633 [cocoa_view_ setFrame: | |
| 634 [(BaseView*)[cocoa_view_ superview] flipRectToNSRect:rect]]; | |
| 635 } | |
| 636 | |
| 622 gfx::NativeView RenderWidgetHostViewMac::GetNativeView() { | 637 gfx::NativeView RenderWidgetHostViewMac::GetNativeView() { |
| 623 return native_view(); | 638 return native_view(); |
| 624 } | 639 } |
| 625 | 640 |
| 626 void RenderWidgetHostViewMac::MovePluginWindows( | 641 void RenderWidgetHostViewMac::MovePluginWindows( |
| 627 const std::vector<webkit::npapi::WebPluginGeometry>& moves) { | 642 const std::vector<webkit::npapi::WebPluginGeometry>& moves) { |
| 628 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 643 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 629 // Handle movement of accelerated plugins, which are the only "windowed" | 644 // Handle movement of accelerated plugins, which are the only "windowed" |
| 630 // plugins that exist on the Mac. | 645 // plugins that exist on the Mac. |
| 631 for (std::vector<webkit::npapi::WebPluginGeometry>::const_iterator iter = | 646 for (std::vector<webkit::npapi::WebPluginGeometry>::const_iterator iter = |
| (...skipping 2113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2745 if (!string) return NO; | 2760 if (!string) return NO; |
| 2746 | 2761 |
| 2747 // If the user is currently using an IME, confirm the IME input, | 2762 // If the user is currently using an IME, confirm the IME input, |
| 2748 // and then insert the text from the service, the same as TextEdit and Safari. | 2763 // and then insert the text from the service, the same as TextEdit and Safari. |
| 2749 [self confirmComposition]; | 2764 [self confirmComposition]; |
| 2750 [self insertText:string]; | 2765 [self insertText:string]; |
| 2751 return YES; | 2766 return YES; |
| 2752 } | 2767 } |
| 2753 | 2768 |
| 2754 @end | 2769 @end |
| OLD | NEW |