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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 RenderWidgetHostViewAura* old_child = | 507 RenderWidgetHostViewAura* old_child = |
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 old_child->popup_parent_host_view_ = NULL; | 514 old_child->popup_parent_host_view_ = NULL; |
515 } | 515 } |
516 popup_parent_host_view_->popup_child_host_view_ = this; | 516 popup_parent_host_view_->popup_child_host_view_ = this; |
517 window_->SetType(aura::client::WINDOW_TYPE_MENU); | 517 window_->SetType(ui::wm::WINDOW_TYPE_MENU); |
518 window_->Init(ui::LAYER_TEXTURED); | 518 window_->Init(ui::LAYER_TEXTURED); |
519 window_->SetName("RenderWidgetHostViewAura"); | 519 window_->SetName("RenderWidgetHostViewAura"); |
520 | 520 |
521 aura::Window* root = popup_parent_host_view_->window_->GetRootWindow(); | 521 aura::Window* root = popup_parent_host_view_->window_->GetRootWindow(); |
522 aura::client::ParentWindowWithContext(window_, root, bounds_in_screen); | 522 aura::client::ParentWindowWithContext(window_, root, bounds_in_screen); |
523 | 523 |
524 SetBounds(bounds_in_screen); | 524 SetBounds(bounds_in_screen); |
525 Show(); | 525 Show(); |
526 } | 526 } |
527 | 527 |
528 void RenderWidgetHostViewAura::InitAsFullscreen( | 528 void RenderWidgetHostViewAura::InitAsFullscreen( |
529 RenderWidgetHostView* reference_host_view) { | 529 RenderWidgetHostView* reference_host_view) { |
530 is_fullscreen_ = true; | 530 is_fullscreen_ = true; |
531 window_->SetType(aura::client::WINDOW_TYPE_NORMAL); | 531 window_->SetType(ui::wm::WINDOW_TYPE_NORMAL); |
532 window_->Init(ui::LAYER_TEXTURED); | 532 window_->Init(ui::LAYER_TEXTURED); |
533 window_->SetName("RenderWidgetHostViewAura"); | 533 window_->SetName("RenderWidgetHostViewAura"); |
534 window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); | 534 window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); |
535 | 535 |
536 aura::Window* parent = NULL; | 536 aura::Window* parent = NULL; |
537 gfx::Rect bounds; | 537 gfx::Rect bounds; |
538 if (reference_host_view) { | 538 if (reference_host_view) { |
539 aura::Window* reference_window = | 539 aura::Window* reference_window = |
540 static_cast<RenderWidgetHostViewAura*>(reference_host_view)->window_; | 540 static_cast<RenderWidgetHostViewAura*>(reference_host_view)->window_; |
541 if (reference_window) { | 541 if (reference_window) { |
(...skipping 2928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3470 RenderWidgetHost* widget) { | 3470 RenderWidgetHost* widget) { |
3471 return new RenderWidgetHostViewAura(widget); | 3471 return new RenderWidgetHostViewAura(widget); |
3472 } | 3472 } |
3473 | 3473 |
3474 // static | 3474 // static |
3475 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 3475 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
3476 GetScreenInfoForWindow(results, NULL); | 3476 GetScreenInfoForWindow(results, NULL); |
3477 } | 3477 } |
3478 | 3478 |
3479 } // namespace content | 3479 } // namespace content |
OLD | NEW |