| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/render_widget_host_view_win.h" | 5 #include "chrome/browser/renderer_host/render_widget_host_view_win.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/l10n_util_win.h" | 8 #include "app/l10n_util_win.h" |
| 9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 | 516 |
| 517 void RenderWidgetHostViewWin::Focus() { | 517 void RenderWidgetHostViewWin::Focus() { |
| 518 if (IsWindow()) | 518 if (IsWindow()) |
| 519 SetFocus(); | 519 SetFocus(); |
| 520 } | 520 } |
| 521 | 521 |
| 522 void RenderWidgetHostViewWin::Blur() { | 522 void RenderWidgetHostViewWin::Blur() { |
| 523 views::FocusManager* focus_manager = | 523 views::FocusManager* focus_manager = |
| 524 views::FocusManager::GetFocusManagerForNativeView(m_hWnd); | 524 views::FocusManager::GetFocusManagerForNativeView(m_hWnd); |
| 525 // We don't have a FocusManager if we are hidden. | 525 // We don't have a FocusManager if we are hidden. |
| 526 if (focus_manager && render_widget_host_->CanBlur()) | 526 if (focus_manager) |
| 527 focus_manager->ClearFocus(); | 527 focus_manager->ClearFocus(); |
| 528 } | 528 } |
| 529 | 529 |
| 530 bool RenderWidgetHostViewWin::HasFocus() { | 530 bool RenderWidgetHostViewWin::HasFocus() { |
| 531 return ::GetFocus() == m_hWnd; | 531 return ::GetFocus() == m_hWnd; |
| 532 } | 532 } |
| 533 | 533 |
| 534 void RenderWidgetHostViewWin::Show() { | 534 void RenderWidgetHostViewWin::Show() { |
| 535 DCHECK(parent_hwnd_); | 535 DCHECK(parent_hwnd_); |
| 536 DCHECK(parent_hwnd_ != GetDesktopWindow()); | 536 DCHECK(parent_hwnd_ != GetDesktopWindow()); |
| (...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1717 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( | 1717 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( |
| 1718 gfx::NativeView native_view) { | 1718 gfx::NativeView native_view) { |
| 1719 if (::IsWindow(native_view)) { | 1719 if (::IsWindow(native_view)) { |
| 1720 HANDLE raw_render_host_view = ::GetProp(native_view, | 1720 HANDLE raw_render_host_view = ::GetProp(native_view, |
| 1721 kRenderWidgetHostViewKey); | 1721 kRenderWidgetHostViewKey); |
| 1722 if (raw_render_host_view) | 1722 if (raw_render_host_view) |
| 1723 return reinterpret_cast<RenderWidgetHostView*>(raw_render_host_view); | 1723 return reinterpret_cast<RenderWidgetHostView*>(raw_render_host_view); |
| 1724 } | 1724 } |
| 1725 return NULL; | 1725 return NULL; |
| 1726 } | 1726 } |
| OLD | NEW |