| 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/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 49 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
| 50 #include "third_party/WebKit/public/web/WebInputEvent.h" | 50 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 51 #include "ui/aura/client/activation_client.h" | 51 #include "ui/aura/client/activation_client.h" |
| 52 #include "ui/aura/client/aura_constants.h" | 52 #include "ui/aura/client/aura_constants.h" |
| 53 #include "ui/aura/client/cursor_client.h" | 53 #include "ui/aura/client/cursor_client.h" |
| 54 #include "ui/aura/client/cursor_client_observer.h" | 54 #include "ui/aura/client/cursor_client_observer.h" |
| 55 #include "ui/aura/client/focus_client.h" | 55 #include "ui/aura/client/focus_client.h" |
| 56 #include "ui/aura/client/screen_position_client.h" | 56 #include "ui/aura/client/screen_position_client.h" |
| 57 #include "ui/aura/client/tooltip_client.h" | 57 #include "ui/aura/client/tooltip_client.h" |
| 58 #include "ui/aura/client/window_tree_client.h" | 58 #include "ui/aura/client/window_tree_client.h" |
| 59 #include "ui/aura/client/window_types.h" | |
| 60 #include "ui/aura/env.h" | 59 #include "ui/aura/env.h" |
| 61 #include "ui/aura/root_window.h" | 60 #include "ui/aura/root_window.h" |
| 62 #include "ui/aura/window.h" | 61 #include "ui/aura/window.h" |
| 63 #include "ui/aura/window_observer.h" | 62 #include "ui/aura/window_observer.h" |
| 64 #include "ui/aura/window_tracker.h" | 63 #include "ui/aura/window_tracker.h" |
| 65 #include "ui/base/clipboard/scoped_clipboard_writer.h" | 64 #include "ui/base/clipboard/scoped_clipboard_writer.h" |
| 66 #include "ui/base/hit_test.h" | 65 #include "ui/base/hit_test.h" |
| 67 #include "ui/base/ime/input_method.h" | 66 #include "ui/base/ime/input_method.h" |
| 68 #include "ui/base/ui_base_types.h" | 67 #include "ui/base/ui_base_types.h" |
| 69 #include "ui/compositor/layer.h" | 68 #include "ui/compositor/layer.h" |
| 70 #include "ui/events/event.h" | 69 #include "ui/events/event.h" |
| 71 #include "ui/events/event_utils.h" | 70 #include "ui/events/event_utils.h" |
| 72 #include "ui/events/gestures/gesture_recognizer.h" | 71 #include "ui/events/gestures/gesture_recognizer.h" |
| 73 #include "ui/gfx/canvas.h" | 72 #include "ui/gfx/canvas.h" |
| 74 #include "ui/gfx/display.h" | 73 #include "ui/gfx/display.h" |
| 75 #include "ui/gfx/rect_conversions.h" | 74 #include "ui/gfx/rect_conversions.h" |
| 76 #include "ui/gfx/screen.h" | 75 #include "ui/gfx/screen.h" |
| 77 #include "ui/gfx/size_conversions.h" | 76 #include "ui/gfx/size_conversions.h" |
| 78 #include "ui/gfx/skia_util.h" | 77 #include "ui/gfx/skia_util.h" |
| 78 #include "ui/wm/public/window_types.h" |
| 79 | 79 |
| 80 #if defined(OS_WIN) | 80 #if defined(OS_WIN) |
| 81 #include "base/win/windows_version.h" | 81 #include "base/win/windows_version.h" |
| 82 #include "content/browser/accessibility/browser_accessibility_manager_win.h" | 82 #include "content/browser/accessibility/browser_accessibility_manager_win.h" |
| 83 #include "content/browser/accessibility/browser_accessibility_win.h" | 83 #include "content/browser/accessibility/browser_accessibility_win.h" |
| 84 #include "content/common/plugin_constants_win.h" | 84 #include "content/common/plugin_constants_win.h" |
| 85 #include "ui/base/win/hidden_window.h" | 85 #include "ui/base/win/hidden_window.h" |
| 86 #include "ui/gfx/gdi_util.h" | 86 #include "ui/gfx/gdi_util.h" |
| 87 #include "ui/gfx/win/dpi.h" | 87 #include "ui/gfx/win/dpi.h" |
| 88 #endif | 88 #endif |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 popup_parent_host_view_->popup_child_host_view_; | 508 popup_parent_host_view_->popup_child_host_view_; |
| 509 if (old_child) { | 509 if (old_child) { |
| 510 // TODO(jhorwich): Allow multiple popup_child_host_view_ per view, or | 510 // TODO(jhorwich): Allow multiple popup_child_host_view_ per view, or |
| 511 // similar mechanism to ensure a second popup doesn't cause the first one | 511 // similar mechanism to ensure a second popup doesn't cause the first one |
| 512 // to never get a chance to filter events. See crbug.com/160589. | 512 // to never get a chance to filter events. See crbug.com/160589. |
| 513 DCHECK(old_child->popup_parent_host_view_ == popup_parent_host_view_); | 513 DCHECK(old_child->popup_parent_host_view_ == popup_parent_host_view_); |
| 514 popup_parent_host_view_->window_->RemoveTransientChild(old_child->window_); | 514 popup_parent_host_view_->window_->RemoveTransientChild(old_child->window_); |
| 515 old_child->popup_parent_host_view_ = NULL; | 515 old_child->popup_parent_host_view_ = NULL; |
| 516 } | 516 } |
| 517 popup_parent_host_view_->popup_child_host_view_ = this; | 517 popup_parent_host_view_->popup_child_host_view_ = this; |
| 518 window_->SetType(aura::client::WINDOW_TYPE_MENU); | 518 window_->SetType(ui::wm::WINDOW_TYPE_MENU); |
| 519 window_->Init(ui::LAYER_TEXTURED); | 519 window_->Init(ui::LAYER_TEXTURED); |
| 520 window_->SetName("RenderWidgetHostViewAura"); | 520 window_->SetName("RenderWidgetHostViewAura"); |
| 521 | 521 |
| 522 aura::Window* root = popup_parent_host_view_->window_->GetRootWindow(); | 522 aura::Window* root = popup_parent_host_view_->window_->GetRootWindow(); |
| 523 aura::client::ParentWindowWithContext(window_, root, bounds_in_screen); | 523 aura::client::ParentWindowWithContext(window_, root, bounds_in_screen); |
| 524 // Setting the transient child allows for the popup to get mouse events when | 524 // Setting the transient child allows for the popup to get mouse events when |
| 525 // in a system modal dialog. | 525 // in a system modal dialog. |
| 526 // This fixes crbug.com/328593. | 526 // This fixes crbug.com/328593. |
| 527 popup_parent_host_view_->window_->AddTransientChild(window_); | 527 popup_parent_host_view_->window_->AddTransientChild(window_); |
| 528 | 528 |
| 529 SetBounds(bounds_in_screen); | 529 SetBounds(bounds_in_screen); |
| 530 Show(); | 530 Show(); |
| 531 } | 531 } |
| 532 | 532 |
| 533 void RenderWidgetHostViewAura::InitAsFullscreen( | 533 void RenderWidgetHostViewAura::InitAsFullscreen( |
| 534 RenderWidgetHostView* reference_host_view) { | 534 RenderWidgetHostView* reference_host_view) { |
| 535 is_fullscreen_ = true; | 535 is_fullscreen_ = true; |
| 536 window_->SetType(aura::client::WINDOW_TYPE_NORMAL); | 536 window_->SetType(ui::wm::WINDOW_TYPE_NORMAL); |
| 537 window_->Init(ui::LAYER_TEXTURED); | 537 window_->Init(ui::LAYER_TEXTURED); |
| 538 window_->SetName("RenderWidgetHostViewAura"); | 538 window_->SetName("RenderWidgetHostViewAura"); |
| 539 window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); | 539 window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); |
| 540 | 540 |
| 541 aura::Window* parent = NULL; | 541 aura::Window* parent = NULL; |
| 542 gfx::Rect bounds; | 542 gfx::Rect bounds; |
| 543 if (reference_host_view) { | 543 if (reference_host_view) { |
| 544 aura::Window* reference_window = | 544 aura::Window* reference_window = |
| 545 static_cast<RenderWidgetHostViewAura*>(reference_host_view)->window_; | 545 static_cast<RenderWidgetHostViewAura*>(reference_host_view)->window_; |
| 546 if (reference_window) { | 546 if (reference_window) { |
| (...skipping 2928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3475 RenderWidgetHost* widget) { | 3475 RenderWidgetHost* widget) { |
| 3476 return new RenderWidgetHostViewAura(widget); | 3476 return new RenderWidgetHostViewAura(widget); |
| 3477 } | 3477 } |
| 3478 | 3478 |
| 3479 // static | 3479 // static |
| 3480 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 3480 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 3481 GetScreenInfoForWindow(results, NULL); | 3481 GetScreenInfoForWindow(results, NULL); |
| 3482 } | 3482 } |
| 3483 | 3483 |
| 3484 } // namespace content | 3484 } // namespace content |
| OLD | NEW |