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