| 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_base.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "content/browser/accessibility/browser_accessibility_manager.h" | 9 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 10 #include "content/browser/gpu/gpu_data_manager_impl.h" | 10 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 | 474 |
| 475 // This RWHV needs to be registered with the TextInputManager so that the | 475 // This RWHV needs to be registered with the TextInputManager so that the |
| 476 // TextInputManager starts tracking its state, and observing its lifetime. | 476 // TextInputManager starts tracking its state, and observing its lifetime. |
| 477 text_input_manager_ = host->delegate()->GetTextInputManager(); | 477 text_input_manager_ = host->delegate()->GetTextInputManager(); |
| 478 if (text_input_manager_) | 478 if (text_input_manager_) |
| 479 text_input_manager_->Register(this); | 479 text_input_manager_->Register(this); |
| 480 | 480 |
| 481 return text_input_manager_; | 481 return text_input_manager_; |
| 482 } | 482 } |
| 483 | 483 |
| 484 RenderWidgetHostImpl* RenderWidgetHostViewBase::ActiveOrFocusedWidget() const { |
| 485 if (text_input_manager_ && text_input_manager_->GetActiveWidget()) |
| 486 return text_input_manager_->GetActiveWidget(); |
| 487 RenderWidgetHostImpl* host = |
| 488 RenderWidgetHostImpl::From(GetRenderWidgetHost()); |
| 489 if (host && host->delegate()) |
| 490 return host->delegate()->GetFocusedRenderWidgetHost(nullptr); |
| 491 return nullptr; |
| 492 } |
| 493 |
| 484 void RenderWidgetHostViewBase::AddObserver( | 494 void RenderWidgetHostViewBase::AddObserver( |
| 485 RenderWidgetHostViewBaseObserver* observer) { | 495 RenderWidgetHostViewBaseObserver* observer) { |
| 486 observers_.AddObserver(observer); | 496 observers_.AddObserver(observer); |
| 487 } | 497 } |
| 488 | 498 |
| 489 void RenderWidgetHostViewBase::RemoveObserver( | 499 void RenderWidgetHostViewBase::RemoveObserver( |
| 490 RenderWidgetHostViewBaseObserver* observer) { | 500 RenderWidgetHostViewBaseObserver* observer) { |
| 491 observers_.RemoveObserver(observer); | 501 observers_.RemoveObserver(observer); |
| 492 } | 502 } |
| 493 | 503 |
| 494 bool RenderWidgetHostViewBase::IsChildFrameForTesting() const { | 504 bool RenderWidgetHostViewBase::IsChildFrameForTesting() const { |
| 495 return false; | 505 return false; |
| 496 } | 506 } |
| 497 | 507 |
| 498 cc::SurfaceId RenderWidgetHostViewBase::SurfaceIdForTesting() const { | 508 cc::SurfaceId RenderWidgetHostViewBase::SurfaceIdForTesting() const { |
| 499 return cc::SurfaceId(); | 509 return cc::SurfaceId(); |
| 500 } | 510 } |
| 501 | 511 |
| 502 } // namespace content | 512 } // namespace content |
| OLD | NEW |