| 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 "content/browser/web_contents/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "content/browser/renderer_host/dip_util.h" | 8 #include "content/browser/renderer_host/dip_util.h" |
| 9 #include "content/browser/renderer_host/render_view_host_factory.h" | 9 #include "content/browser/renderer_host/render_view_host_factory.h" |
| 10 #include "content/browser/web_contents/interstitial_page_impl.h" | 10 #include "content/browser/web_contents/interstitial_page_impl.h" |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 | 297 |
| 298 gfx::NativeView WebContentsViewAura::GetContentNativeView() const { | 298 gfx::NativeView WebContentsViewAura::GetContentNativeView() const { |
| 299 return view_->GetNativeView(); | 299 return view_->GetNativeView(); |
| 300 } | 300 } |
| 301 | 301 |
| 302 gfx::NativeWindow WebContentsViewAura::GetTopLevelNativeWindow() const { | 302 gfx::NativeWindow WebContentsViewAura::GetTopLevelNativeWindow() const { |
| 303 return window_->GetToplevelWindow(); | 303 return window_->GetToplevelWindow(); |
| 304 } | 304 } |
| 305 | 305 |
| 306 void WebContentsViewAura::GetContainerBounds(gfx::Rect *out) const { | 306 void WebContentsViewAura::GetContainerBounds(gfx::Rect *out) const { |
| 307 *out = window_->GetScreenBounds(); | 307 *out = window_->GetBoundsInScreen(); |
| 308 } | 308 } |
| 309 | 309 |
| 310 void WebContentsViewAura::SetPageTitle(const string16& title) { | 310 void WebContentsViewAura::SetPageTitle(const string16& title) { |
| 311 window_->set_title(title); | 311 window_->set_title(title); |
| 312 } | 312 } |
| 313 | 313 |
| 314 void WebContentsViewAura::OnTabCrashed(base::TerminationStatus status, | 314 void WebContentsViewAura::OnTabCrashed(base::TerminationStatus status, |
| 315 int error_code) { | 315 int error_code) { |
| 316 view_ = NULL; | 316 view_ = NULL; |
| 317 // Set the focus to the parent because neither the view window nor this | 317 // Set the focus to the parent because neither the view window nor this |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 } | 391 } |
| 392 | 392 |
| 393 bool WebContentsViewAura::IsEventTracking() const { | 393 bool WebContentsViewAura::IsEventTracking() const { |
| 394 return false; | 394 return false; |
| 395 } | 395 } |
| 396 | 396 |
| 397 void WebContentsViewAura::CloseTabAfterEventTracking() { | 397 void WebContentsViewAura::CloseTabAfterEventTracking() { |
| 398 } | 398 } |
| 399 | 399 |
| 400 gfx::Rect WebContentsViewAura::GetViewBounds() const { | 400 gfx::Rect WebContentsViewAura::GetViewBounds() const { |
| 401 return window_->GetRootWindowBounds(); | 401 return window_->GetBoundsInRootWindow(); |
| 402 } | 402 } |
| 403 | 403 |
| 404 //////////////////////////////////////////////////////////////////////////////// | 404 //////////////////////////////////////////////////////////////////////////////// |
| 405 // WebContentsViewAura, RenderViewHostDelegateView implementation: | 405 // WebContentsViewAura, RenderViewHostDelegateView implementation: |
| 406 | 406 |
| 407 void WebContentsViewAura::ShowContextMenu( | 407 void WebContentsViewAura::ShowContextMenu( |
| 408 const content::ContextMenuParams& params) { | 408 const content::ContextMenuParams& params) { |
| 409 if (delegate_.get()) | 409 if (delegate_.get()) |
| 410 delegate_->ShowContextMenu(params); | 410 delegate_->ShowContextMenu(params); |
| 411 } | 411 } |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 OnDragEntered(event); | 635 OnDragEntered(event); |
| 636 | 636 |
| 637 web_contents_->GetRenderViewHost()->DragTargetDrop( | 637 web_contents_->GetRenderViewHost()->DragTargetDrop( |
| 638 event.location(), | 638 event.location(), |
| 639 GetNativeView()->GetRootWindow()->last_mouse_location(), | 639 GetNativeView()->GetRootWindow()->last_mouse_location(), |
| 640 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); | 640 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); |
| 641 if (drag_dest_delegate_) | 641 if (drag_dest_delegate_) |
| 642 drag_dest_delegate_->OnDrop(); | 642 drag_dest_delegate_->OnDrop(); |
| 643 return current_drag_op_; | 643 return current_drag_op_; |
| 644 } | 644 } |
| OLD | NEW |