OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/logging.h" | 7 #include "base/logging.h" |
8 #include "content/browser/renderer_host/backing_store_skia.h" | 8 #include "content/browser/renderer_host/backing_store_skia.h" |
9 #include "content/browser/renderer_host/render_widget_host.h" | 9 #include "content/browser/renderer_host/render_widget_host.h" |
10 #include "content/browser/renderer_host/web_input_event_aura.h" | 10 #include "content/browser/renderer_host/web_input_event_aura.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 ALLOW_THIS_IN_INITIALIZER_LIST(window_(new aura::Window(this))), | 93 ALLOW_THIS_IN_INITIALIZER_LIST(window_(new aura::Window(this))), |
94 is_fullscreen_(false), | 94 is_fullscreen_(false), |
95 popup_parent_host_view_(NULL), | 95 popup_parent_host_view_(NULL), |
96 is_loading_(false), | 96 is_loading_(false), |
97 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) | 97 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) |
98 current_surface_(gfx::kNullPluginWindow), | 98 current_surface_(gfx::kNullPluginWindow), |
99 #endif | 99 #endif |
100 skip_schedule_paint_(false) { | 100 skip_schedule_paint_(false) { |
101 host_->SetView(this); | 101 host_->SetView(this); |
102 window_->SetProperty(aura::kTooltipTextKey, &tooltip_); | 102 window_->SetProperty(aura::kTooltipTextKey, &tooltip_); |
| 103 aura::ActivationDelegate::SetActivationDelegate(window_, this); |
103 } | 104 } |
104 | 105 |
105 RenderWidgetHostViewAura::~RenderWidgetHostViewAura() { | 106 RenderWidgetHostViewAura::~RenderWidgetHostViewAura() { |
106 } | 107 } |
107 | 108 |
108 void RenderWidgetHostViewAura::InitAsChild() { | 109 void RenderWidgetHostViewAura::InitAsChild() { |
109 window_->Init(ui::Layer::LAYER_HAS_TEXTURE); | 110 window_->Init(ui::Layer::LAYER_HAS_TEXTURE); |
110 window_->SetName("RenderWidgetHostViewAura"); | 111 window_->SetName("RenderWidgetHostViewAura"); |
111 } | 112 } |
112 | 113 |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 UpdateWebTouchEventAfterDispatch(&touch_event_, point); | 536 UpdateWebTouchEventAfterDispatch(&touch_event_, point); |
536 } | 537 } |
537 | 538 |
538 return DecideTouchStatus(touch_event_, point); | 539 return DecideTouchStatus(touch_event_, point); |
539 } | 540 } |
540 | 541 |
541 bool RenderWidgetHostViewAura::CanFocus() { | 542 bool RenderWidgetHostViewAura::CanFocus() { |
542 return popup_type_ == WebKit::WebPopupTypeNone; | 543 return popup_type_ == WebKit::WebPopupTypeNone; |
543 } | 544 } |
544 | 545 |
545 bool RenderWidgetHostViewAura::ShouldActivate(aura::Event* event) { | |
546 return false; | |
547 } | |
548 | |
549 void RenderWidgetHostViewAura::OnActivated() { | |
550 } | |
551 | |
552 void RenderWidgetHostViewAura::OnLostActive() { | |
553 } | |
554 | |
555 void RenderWidgetHostViewAura::OnCaptureLost() { | 546 void RenderWidgetHostViewAura::OnCaptureLost() { |
556 host_->LostCapture(); | 547 host_->LostCapture(); |
557 } | 548 } |
558 | 549 |
559 void RenderWidgetHostViewAura::OnPaint(gfx::Canvas* canvas) { | 550 void RenderWidgetHostViewAura::OnPaint(gfx::Canvas* canvas) { |
560 if (!window_->IsVisible()) | 551 if (!window_->IsVisible()) |
561 return; | 552 return; |
562 skip_schedule_paint_ = true; | 553 skip_schedule_paint_ = true; |
563 BackingStore* backing_store = host_->GetBackingStore(true); | 554 BackingStore* backing_store = host_->GetBackingStore(true); |
564 skip_schedule_paint_ = false; | 555 skip_schedule_paint_ = false; |
(...skipping 10 matching lines...) Expand all Loading... |
575 } | 566 } |
576 | 567 |
577 void RenderWidgetHostViewAura::OnWindowDestroyed() { | 568 void RenderWidgetHostViewAura::OnWindowDestroyed() { |
578 host_->ViewDestroyed(); | 569 host_->ViewDestroyed(); |
579 delete this; | 570 delete this; |
580 } | 571 } |
581 | 572 |
582 void RenderWidgetHostViewAura::OnWindowVisibilityChanged(bool visible) { | 573 void RenderWidgetHostViewAura::OnWindowVisibilityChanged(bool visible) { |
583 } | 574 } |
584 | 575 |
| 576 //////////////////////////////////////////////////////////////////////////////// |
| 577 // RenderWidgetHostViewAura, aura::ActivationDelegate implementation: |
| 578 |
| 579 bool RenderWidgetHostViewAura::ShouldActivate(aura::Event* event) { |
| 580 return false; |
| 581 } |
| 582 |
| 583 void RenderWidgetHostViewAura::OnActivated() { |
| 584 } |
| 585 |
| 586 void RenderWidgetHostViewAura::OnLostActive() { |
| 587 } |
| 588 |
585 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) | 589 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) |
586 //////////////////////////////////////////////////////////////////////////////// | 590 //////////////////////////////////////////////////////////////////////////////// |
587 // RenderWidgetHostViewAura, ui::CompositorDelegate implementation: | 591 // RenderWidgetHostViewAura, ui::CompositorDelegate implementation: |
588 | 592 |
589 void RenderWidgetHostViewAura::OnCompositingEnded(ui::Compositor* compositor) { | 593 void RenderWidgetHostViewAura::OnCompositingEnded(ui::Compositor* compositor) { |
590 for (std::vector< base::Callback<void(void)> >::const_iterator | 594 for (std::vector< base::Callback<void(void)> >::const_iterator |
591 it = on_compositing_ended_callbacks_.begin(); | 595 it = on_compositing_ended_callbacks_.begin(); |
592 it != on_compositing_ended_callbacks_.end(); ++it) { | 596 it != on_compositing_ended_callbacks_.end(); ++it) { |
593 it->Run(); | 597 it->Run(); |
594 } | 598 } |
(...skipping 24 matching lines...) Expand all Loading... |
619 // static | 623 // static |
620 void RenderWidgetHostView::GetDefaultScreenInfo( | 624 void RenderWidgetHostView::GetDefaultScreenInfo( |
621 WebKit::WebScreenInfo* results) { | 625 WebKit::WebScreenInfo* results) { |
622 const gfx::Size size = gfx::Screen::GetPrimaryMonitorSize(); | 626 const gfx::Size size = gfx::Screen::GetPrimaryMonitorSize(); |
623 results->rect = WebKit::WebRect(0, 0, size.width(), size.height()); | 627 results->rect = WebKit::WebRect(0, 0, size.width(), size.height()); |
624 results->availableRect = results->rect; | 628 results->availableRect = results->rect; |
625 // TODO(derat): Don't hardcode this? | 629 // TODO(derat): Don't hardcode this? |
626 results->depth = 24; | 630 results->depth = 24; |
627 results->depthPerComponent = 8; | 631 results->depthPerComponent = 8; |
628 } | 632 } |
OLD | NEW |