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" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/debug/trace_event.h" | 12 #include "base/debug/trace_event.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
16 #include "cc/base/switches.h" | |
16 #include "cc/layers/layer.h" | 17 #include "cc/layers/layer.h" |
17 #include "cc/output/copy_output_request.h" | 18 #include "cc/output/copy_output_request.h" |
18 #include "cc/output/copy_output_result.h" | 19 #include "cc/output/copy_output_result.h" |
19 #include "cc/resources/texture_mailbox.h" | 20 #include "cc/resources/texture_mailbox.h" |
20 #include "cc/trees/layer_tree_settings.h" | 21 #include "cc/trees/layer_tree_settings.h" |
21 #include "content/browser/accessibility/browser_accessibility_manager.h" | 22 #include "content/browser/accessibility/browser_accessibility_manager.h" |
22 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 23 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
23 #include "content/browser/frame_host/frame_tree.h" | 24 #include "content/browser/frame_host/frame_tree.h" |
24 #include "content/browser/frame_host/frame_tree_node.h" | 25 #include "content/browser/frame_host/frame_tree_node.h" |
25 #include "content/browser/frame_host/render_frame_host_impl.h" | 26 #include "content/browser/frame_host/render_frame_host_impl.h" |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
474 | 475 |
475 bool RenderWidgetHostViewAura::OnMessageReceived( | 476 bool RenderWidgetHostViewAura::OnMessageReceived( |
476 const IPC::Message& message) { | 477 const IPC::Message& message) { |
477 bool handled = true; | 478 bool handled = true; |
478 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAura, message) | 479 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAura, message) |
479 // TODO(kevers): Move to RenderWidgetHostViewImpl and consolidate IPC | 480 // TODO(kevers): Move to RenderWidgetHostViewImpl and consolidate IPC |
480 // messages for TextInput<State|Type>Changed. Corresponding code in | 481 // messages for TextInput<State|Type>Changed. Corresponding code in |
481 // RenderWidgetHostViewAndroid should also be moved at the same time. | 482 // RenderWidgetHostViewAndroid should also be moved at the same time. |
482 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged, | 483 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged, |
483 OnTextInputStateChanged) | 484 OnTextInputStateChanged) |
485 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrames, | |
486 OnSetNeedsBeginFrames) | |
484 IPC_MESSAGE_UNHANDLED(handled = false) | 487 IPC_MESSAGE_UNHANDLED(handled = false) |
485 IPC_END_MESSAGE_MAP() | 488 IPC_END_MESSAGE_MAP() |
486 return handled; | 489 return handled; |
487 } | 490 } |
488 | 491 |
489 void RenderWidgetHostViewAura::InitAsChild( | 492 void RenderWidgetHostViewAura::InitAsChild( |
490 gfx::NativeView parent_view) { | 493 gfx::NativeView parent_view) { |
491 window_->SetType(ui::wm::WINDOW_TYPE_CONTROL); | 494 window_->SetType(ui::wm::WINDOW_TYPE_CONTROL); |
492 window_->Init(aura::WINDOW_LAYER_SOLID_COLOR); | 495 window_->Init(aura::WINDOW_LAYER_SOLID_COLOR); |
493 window_->SetName("RenderWidgetHostViewAura"); | 496 window_->SetName("RenderWidgetHostViewAura"); |
(...skipping 2023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2517 } | 2520 } |
2518 #endif | 2521 #endif |
2519 | 2522 |
2520 host_->ForwardKeyboardEvent(event); | 2523 host_->ForwardKeyboardEvent(event); |
2521 } | 2524 } |
2522 | 2525 |
2523 SkColorType RenderWidgetHostViewAura::PreferredReadbackFormat() { | 2526 SkColorType RenderWidgetHostViewAura::PreferredReadbackFormat() { |
2524 return kN32_SkColorType; | 2527 return kN32_SkColorType; |
2525 } | 2528 } |
2526 | 2529 |
2530 void RenderWidgetHostViewAura::OnSetNeedsBeginFrames(bool needs_begin_frames) { | |
2531 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | |
brianderson
2014/12/09 03:00:31
Should probably make this a simple dcheck ona bool
simonhong
2014/12/09 17:09:27
I think this can be removed because DelegatedFrame
| |
2532 cc::switches::kEnableBeginFrameScheduling)); | |
2533 delegated_frame_host_->OnSetNeedsBeginFrames(needs_begin_frames); | |
2534 } | |
2535 | |
2527 //////////////////////////////////////////////////////////////////////////////// | 2536 //////////////////////////////////////////////////////////////////////////////// |
2528 // DelegatedFrameHost, public: | 2537 // DelegatedFrameHostClient, public: |
2529 | 2538 |
2530 ui::Compositor* RenderWidgetHostViewAura::GetCompositor() const { | 2539 ui::Compositor* RenderWidgetHostViewAura::GetCompositor() const { |
2531 aura::WindowTreeHost* host = window_->GetHost(); | 2540 aura::WindowTreeHost* host = window_->GetHost(); |
2532 return host ? host->compositor() : NULL; | 2541 return host ? host->compositor() : NULL; |
2533 } | 2542 } |
2534 | 2543 |
2535 ui::Layer* RenderWidgetHostViewAura::GetLayer() { | 2544 ui::Layer* RenderWidgetHostViewAura::GetLayer() { |
2536 return window_->layer(); | 2545 return window_->layer(); |
2537 } | 2546 } |
2538 | 2547 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2573 | 2582 |
2574 //////////////////////////////////////////////////////////////////////////////// | 2583 //////////////////////////////////////////////////////////////////////////////// |
2575 // RenderWidgetHostViewBase, public: | 2584 // RenderWidgetHostViewBase, public: |
2576 | 2585 |
2577 // static | 2586 // static |
2578 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { | 2587 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { |
2579 GetScreenInfoForWindow(results, NULL); | 2588 GetScreenInfoForWindow(results, NULL); |
2580 } | 2589 } |
2581 | 2590 |
2582 } // namespace content | 2591 } // namespace content |
OLD | NEW |