| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/tab_contents/tab_contents_view_mac.h" | 5 #include "chrome/browser/tab_contents/tab_contents_view_mac.h" |
| 6 | 6 |
| 7 #include "chrome/browser/browser.h" // TODO(beng): this dependency is awful. | 7 #include "chrome/browser/browser.h" // TODO(beng): this dependency is awful. |
| 8 #include "chrome/browser/cocoa/sad_tab_view.h" | 8 #include "chrome/browser/cocoa/sad_tab_view.h" |
| 9 #include "chrome/browser/renderer_host/render_widget_host.h" | 9 #include "chrome/browser/renderer_host/render_widget_host.h" |
| 10 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" | 10 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 if (TabContentsView_->tab_contents()->delegate()) { | 254 if (TabContentsView_->tab_contents()->delegate()) { |
| 255 if ([theEvent type] == NSMouseMoved) | 255 if ([theEvent type] == NSMouseMoved) |
| 256 TabContentsView_->tab_contents()->delegate()-> | 256 TabContentsView_->tab_contents()->delegate()-> |
| 257 ContentsMouseEvent(TabContentsView_->tab_contents(), true); | 257 ContentsMouseEvent(TabContentsView_->tab_contents(), true); |
| 258 if ([theEvent type] == NSMouseExited) | 258 if ([theEvent type] == NSMouseExited) |
| 259 TabContentsView_->tab_contents()->delegate()-> | 259 TabContentsView_->tab_contents()->delegate()-> |
| 260 ContentsMouseEvent(TabContentsView_->tab_contents(), false); | 260 ContentsMouseEvent(TabContentsView_->tab_contents(), false); |
| 261 } | 261 } |
| 262 } | 262 } |
| 263 | 263 |
| 264 - (BOOL)mouseDownCanMoveWindow { |
| 265 // This is needed to prevent mouseDowns from moving the window |
| 266 // around. The default implementation returns YES only for opaque |
| 267 // views. TabContentsViewCocoa does not draw itself in any way, but |
| 268 // its subviews do paint their entire frames. Returning NO here |
| 269 // saves us the effort of overriding this method in every possible |
| 270 // subview. |
| 271 return NO; |
| 272 } |
| 273 |
| 264 // In the Windows version, we always have cut/copy/paste enabled. This is sub- | 274 // In the Windows version, we always have cut/copy/paste enabled. This is sub- |
| 265 // optimal, but we do it too. TODO(avi): Plumb the "can*" methods up from | 275 // optimal, but we do it too. TODO(avi): Plumb the "can*" methods up from |
| 266 // WebCore. | 276 // WebCore. |
| 267 | 277 |
| 268 - (void)cut:(id)sender { | 278 - (void)cut:(id)sender { |
| 269 TabContentsView_->tab_contents()->Cut(); | 279 TabContentsView_->tab_contents()->Cut(); |
| 270 } | 280 } |
| 271 | 281 |
| 272 - (void)copy:(id)sender { | 282 - (void)copy:(id)sender { |
| 273 TabContentsView_->tab_contents()->Copy(); | 283 TabContentsView_->tab_contents()->Copy(); |
| 274 } | 284 } |
| 275 | 285 |
| 276 - (void)paste:(id)sender { | 286 - (void)paste:(id)sender { |
| 277 TabContentsView_->tab_contents()->Paste(); | 287 TabContentsView_->tab_contents()->Paste(); |
| 278 } | 288 } |
| 279 | 289 |
| 280 // Tons of stuff goes here, where we grab events going on in Cocoaland and send | 290 // Tons of stuff goes here, where we grab events going on in Cocoaland and send |
| 281 // them into the C++ system. TODO(avi): all that jazz | 291 // them into the C++ system. TODO(avi): all that jazz |
| 282 | 292 |
| 283 @end | 293 @end |
| OLD | NEW |