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_win.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
12 #include "base/process_util.h" | 12 #include "base/process_util.h" |
13 #include "base/threading/thread.h" | 13 #include "base/threading/thread.h" |
14 #include "base/win/scoped_comptr.h" | 14 #include "base/win/scoped_comptr.h" |
15 #include "base/win/scoped_gdi_object.h" | 15 #include "base/win/scoped_gdi_object.h" |
16 #include "base/win/win_util.h" | 16 #include "base/win/win_util.h" |
17 #include "base/win/windows_version.h" | 17 #include "base/win/windows_version.h" |
18 #include "base/win/wrapped_window_proc.h" | 18 #include "base/win/wrapped_window_proc.h" |
19 #include "content/browser/accessibility/browser_accessibility_manager.h" | 19 #include "content/browser/accessibility/browser_accessibility_manager.h" |
20 #include "content/browser/accessibility/browser_accessibility_state.h" | 20 #include "content/browser/accessibility/browser_accessibility_state.h" |
21 #include "content/browser/accessibility/browser_accessibility_win.h" | 21 #include "content/browser/accessibility/browser_accessibility_win.h" |
22 #include "content/browser/plugin_process_host.h" | 22 #include "content/browser/plugin_process_host.h" |
23 #include "content/browser/renderer_host/backing_store.h" | 23 #include "content/browser/renderer_host/backing_store.h" |
24 #include "content/browser/renderer_host/backing_store_win.h" | 24 #include "content/browser/renderer_host/backing_store_win.h" |
25 #include "content/browser/renderer_host/render_process_host.h" | 25 #include "content/browser/renderer_host/render_process_host_impl.h" |
26 #include "content/browser/renderer_host/render_widget_host.h" | 26 #include "content/browser/renderer_host/render_widget_host.h" |
27 #include "content/common/plugin_messages.h" | 27 #include "content/common/plugin_messages.h" |
28 #include "content/common/view_messages.h" | 28 #include "content/common/view_messages.h" |
29 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
30 #include "content/public/browser/content_browser_client.h" | 30 #include "content/public/browser/content_browser_client.h" |
31 #include "content/public/browser/native_web_keyboard_event.h" | 31 #include "content/public/browser/native_web_keyboard_event.h" |
32 #include "content/public/browser/notification_service.h" | 32 #include "content/public/browser/notification_service.h" |
33 #include "content/public/browser/notification_types.h" | 33 #include "content/public/browser/notification_types.h" |
34 #include "content/public/common/content_switches.h" | 34 #include "content/public/common/content_switches.h" |
35 #include "content/public/common/page_zoom.h" | 35 #include "content/public/common/page_zoom.h" |
(...skipping 1868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1904 } | 1904 } |
1905 | 1905 |
1906 void RenderWidgetHostViewWin::Observe( | 1906 void RenderWidgetHostViewWin::Observe( |
1907 int type, | 1907 int type, |
1908 const content::NotificationSource& source, | 1908 const content::NotificationSource& source, |
1909 const content::NotificationDetails& details) { | 1909 const content::NotificationDetails& details) { |
1910 DCHECK(type == content::NOTIFICATION_RENDERER_PROCESS_TERMINATED); | 1910 DCHECK(type == content::NOTIFICATION_RENDERER_PROCESS_TERMINATED); |
1911 | 1911 |
1912 // Get the RenderProcessHost that posted this notification, and exit | 1912 // Get the RenderProcessHost that posted this notification, and exit |
1913 // if it's not the one associated with this host view. | 1913 // if it's not the one associated with this host view. |
1914 RenderProcessHost* render_process_host = | 1914 content::RenderProcessHost* render_process_host = |
1915 content::Source<RenderProcessHost>(source).ptr(); | 1915 content::Source<content::RenderProcessHost>(source).ptr(); |
1916 DCHECK(render_process_host); | 1916 DCHECK(render_process_host); |
1917 if (!render_widget_host_ || | 1917 if (!render_widget_host_ || |
1918 render_process_host != render_widget_host_->process()) | 1918 render_process_host != render_widget_host_->process()) |
1919 return; | 1919 return; |
1920 | 1920 |
1921 // If it was our RenderProcessHost that posted the notification, | 1921 // If it was our RenderProcessHost that posted the notification, |
1922 // clear the BrowserAccessibilityManager, because the renderer is | 1922 // clear the BrowserAccessibilityManager, because the renderer is |
1923 // dead and any accessibility information we have is now stale. | 1923 // dead and any accessibility information we have is now stale. |
1924 browser_accessibility_manager_.reset(NULL); | 1924 browser_accessibility_manager_.reset(NULL); |
1925 } | 1925 } |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2429 | 2429 |
2430 size_t offset = selection_range_.GetMin() - selection_text_offset_; | 2430 size_t offset = selection_range_.GetMin() - selection_text_offset_; |
2431 memcpy(reinterpret_cast<char*>(reconv) + sizeof(RECONVERTSTRING), | 2431 memcpy(reinterpret_cast<char*>(reconv) + sizeof(RECONVERTSTRING), |
2432 selection_text_.c_str() + offset, len * sizeof(WCHAR)); | 2432 selection_text_.c_str() + offset, len * sizeof(WCHAR)); |
2433 | 2433 |
2434 // According to Microsft API document, IMR_RECONVERTSTRING and | 2434 // According to Microsft API document, IMR_RECONVERTSTRING and |
2435 // IMR_DOCUMENTFEED should return reconv, but some applications return | 2435 // IMR_DOCUMENTFEED should return reconv, but some applications return |
2436 // need_size. | 2436 // need_size. |
2437 return reinterpret_cast<LRESULT>(reconv); | 2437 return reinterpret_cast<LRESULT>(reconv); |
2438 } | 2438 } |
OLD | NEW |