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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 | 421 |
422 private: | 422 private: |
423 RenderWidgetHostViewAura* view_; | 423 RenderWidgetHostViewAura* view_; |
424 | 424 |
425 DISALLOW_COPY_AND_ASSIGN(WindowObserver); | 425 DISALLOW_COPY_AND_ASSIGN(WindowObserver); |
426 }; | 426 }; |
427 | 427 |
428 //////////////////////////////////////////////////////////////////////////////// | 428 //////////////////////////////////////////////////////////////////////////////// |
429 // RenderWidgetHostViewAura, public: | 429 // RenderWidgetHostViewAura, public: |
430 | 430 |
431 RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host) | 431 RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host, |
| 432 bool is_guest_view_hack) |
432 : host_(RenderWidgetHostImpl::From(host)), | 433 : host_(RenderWidgetHostImpl::From(host)), |
433 window_(new aura::Window(this)), | 434 window_(new aura::Window(this)), |
434 delegated_frame_host_(new DelegatedFrameHost(this)), | 435 delegated_frame_host_(new DelegatedFrameHost(this)), |
435 in_shutdown_(false), | 436 in_shutdown_(false), |
436 in_bounds_changed_(false), | 437 in_bounds_changed_(false), |
437 is_fullscreen_(false), | 438 is_fullscreen_(false), |
438 popup_parent_host_view_(NULL), | 439 popup_parent_host_view_(NULL), |
439 popup_child_host_view_(NULL), | 440 popup_child_host_view_(NULL), |
440 is_loading_(false), | 441 is_loading_(false), |
441 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), | 442 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), |
442 text_input_mode_(ui::TEXT_INPUT_MODE_DEFAULT), | 443 text_input_mode_(ui::TEXT_INPUT_MODE_DEFAULT), |
443 can_compose_inline_(true), | 444 can_compose_inline_(true), |
444 has_composition_text_(false), | 445 has_composition_text_(false), |
445 accept_return_character_(false), | 446 accept_return_character_(false), |
446 last_swapped_software_frame_scale_factor_(1.f), | 447 last_swapped_software_frame_scale_factor_(1.f), |
447 paint_canvas_(NULL), | 448 paint_canvas_(NULL), |
448 synthetic_move_sent_(false), | 449 synthetic_move_sent_(false), |
449 cursor_visibility_state_in_renderer_(UNKNOWN), | 450 cursor_visibility_state_in_renderer_(UNKNOWN), |
450 #if defined(OS_WIN) | 451 #if defined(OS_WIN) |
451 legacy_render_widget_host_HWND_(NULL), | 452 legacy_render_widget_host_HWND_(NULL), |
452 legacy_window_destroyed_(false), | 453 legacy_window_destroyed_(false), |
453 #endif | 454 #endif |
454 has_snapped_to_boundary_(false), | 455 has_snapped_to_boundary_(false), |
455 touch_editing_client_(NULL), | 456 touch_editing_client_(NULL), |
| 457 is_guest_view_hack_(is_guest_view_hack), |
456 weak_ptr_factory_(this) { | 458 weak_ptr_factory_(this) { |
457 host_->SetView(this); | 459 if (!is_guest_view_hack_) |
| 460 host_->SetView(this); |
| 461 |
458 window_observer_.reset(new WindowObserver(this)); | 462 window_observer_.reset(new WindowObserver(this)); |
459 aura::client::SetTooltipText(window_, &tooltip_); | 463 aura::client::SetTooltipText(window_, &tooltip_); |
460 aura::client::SetActivationDelegate(window_, this); | 464 aura::client::SetActivationDelegate(window_, this); |
461 aura::client::SetActivationChangeObserver(window_, this); | 465 aura::client::SetActivationChangeObserver(window_, this); |
462 aura::client::SetFocusChangeObserver(window_, this); | 466 aura::client::SetFocusChangeObserver(window_, this); |
463 window_->set_layer_owner_delegate(delegated_frame_host_.get()); | 467 window_->set_layer_owner_delegate(delegated_frame_host_.get()); |
464 gfx::Screen::GetScreenFor(window_)->AddObserver(this); | 468 gfx::Screen::GetScreenFor(window_)->AddObserver(this); |
465 | 469 |
466 bool overscroll_enabled = base::CommandLine::ForCurrentProcess()-> | 470 bool overscroll_enabled = base::CommandLine::ForCurrentProcess()-> |
467 GetSwitchValueASCII(switches::kOverscrollHistoryNavigation) != "0"; | 471 GetSwitchValueASCII(switches::kOverscrollHistoryNavigation) != "0"; |
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1737 // to the input method). | 1741 // to the input method). |
1738 ui::InputMethod* input_method = GetInputMethod(); | 1742 ui::InputMethod* input_method = GetInputMethod(); |
1739 if (input_method) | 1743 if (input_method) |
1740 input_method->DetachTextInputClient(this); | 1744 input_method->DetachTextInputClient(this); |
1741 | 1745 |
1742 if (overscroll_controller_) | 1746 if (overscroll_controller_) |
1743 overscroll_controller_->Reset(); | 1747 overscroll_controller_->Reset(); |
1744 } | 1748 } |
1745 | 1749 |
1746 void RenderWidgetHostViewAura::OnWindowDestroyed(aura::Window* window) { | 1750 void RenderWidgetHostViewAura::OnWindowDestroyed(aura::Window* window) { |
1747 host_->ViewDestroyed(); | 1751 // Ask the RWH to drop reference to us. |
| 1752 if (!is_guest_view_hack_) |
| 1753 host_->ViewDestroyed(); |
| 1754 |
1748 delete this; | 1755 delete this; |
1749 } | 1756 } |
1750 | 1757 |
1751 void RenderWidgetHostViewAura::OnWindowTargetVisibilityChanged(bool visible) { | 1758 void RenderWidgetHostViewAura::OnWindowTargetVisibilityChanged(bool visible) { |
1752 } | 1759 } |
1753 | 1760 |
1754 bool RenderWidgetHostViewAura::HasHitTestMask() const { | 1761 bool RenderWidgetHostViewAura::HasHitTestMask() const { |
1755 return false; | 1762 return false; |
1756 } | 1763 } |
1757 | 1764 |
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2578 | 2585 |
2579 //////////////////////////////////////////////////////////////////////////////// | 2586 //////////////////////////////////////////////////////////////////////////////// |
2580 // RenderWidgetHostViewBase, public: | 2587 // RenderWidgetHostViewBase, public: |
2581 | 2588 |
2582 // static | 2589 // static |
2583 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { | 2590 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { |
2584 GetScreenInfoForWindow(results, NULL); | 2591 GetScreenInfoForWindow(results, NULL); |
2585 } | 2592 } |
2586 | 2593 |
2587 } // namespace content | 2594 } // namespace content |
OLD | NEW |