OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/resource_message_filter.h" | 5 #include "chrome/browser/renderer_host/resource_message_filter.h" |
6 | 6 |
7 #include "base/clipboard.h" | 7 #include "base/clipboard.h" |
8 #include "base/gfx/native_widget_types.h" | 8 #include "base/gfx/native_widget_types.h" |
9 #include "base/histogram.h" | 9 #include "base/histogram.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 IPC_MESSAGE_HANDLER(ViewHostMsg_ClipboardIsFormatAvailable, | 198 IPC_MESSAGE_HANDLER(ViewHostMsg_ClipboardIsFormatAvailable, |
199 OnClipboardIsFormatAvailable) | 199 OnClipboardIsFormatAvailable) |
200 IPC_MESSAGE_HANDLER(ViewHostMsg_ClipboardReadText, OnClipboardReadText) | 200 IPC_MESSAGE_HANDLER(ViewHostMsg_ClipboardReadText, OnClipboardReadText) |
201 IPC_MESSAGE_HANDLER(ViewHostMsg_ClipboardReadAsciiText, | 201 IPC_MESSAGE_HANDLER(ViewHostMsg_ClipboardReadAsciiText, |
202 OnClipboardReadAsciiText) | 202 OnClipboardReadAsciiText) |
203 IPC_MESSAGE_HANDLER(ViewHostMsg_ClipboardReadHTML, | 203 IPC_MESSAGE_HANDLER(ViewHostMsg_ClipboardReadHTML, |
204 OnClipboardReadHTML) | 204 OnClipboardReadHTML) |
205 #if defined(OS_WIN) | 205 #if defined(OS_WIN) |
206 IPC_MESSAGE_HANDLER(ViewHostMsg_GetWindowRect, OnGetWindowRect) | 206 IPC_MESSAGE_HANDLER(ViewHostMsg_GetWindowRect, OnGetWindowRect) |
207 IPC_MESSAGE_HANDLER(ViewHostMsg_GetRootWindowRect, OnGetRootWindowRect) | 207 IPC_MESSAGE_HANDLER(ViewHostMsg_GetRootWindowRect, OnGetRootWindowRect) |
208 IPC_MESSAGE_HANDLER(ViewHostMsg_GetRootWindowResizerRect, | |
209 OnGetRootWindowResizerRect) | |
210 #endif | 208 #endif |
211 IPC_MESSAGE_HANDLER(ViewHostMsg_GetMimeTypeFromExtension, | 209 IPC_MESSAGE_HANDLER(ViewHostMsg_GetMimeTypeFromExtension, |
212 OnGetMimeTypeFromExtension) | 210 OnGetMimeTypeFromExtension) |
213 IPC_MESSAGE_HANDLER(ViewHostMsg_GetMimeTypeFromFile, | 211 IPC_MESSAGE_HANDLER(ViewHostMsg_GetMimeTypeFromFile, |
214 OnGetMimeTypeFromFile) | 212 OnGetMimeTypeFromFile) |
215 IPC_MESSAGE_HANDLER(ViewHostMsg_GetPreferredExtensionForMimeType, | 213 IPC_MESSAGE_HANDLER(ViewHostMsg_GetPreferredExtensionForMimeType, |
216 OnGetPreferredExtensionForMimeType) | 214 OnGetPreferredExtensionForMimeType) |
217 IPC_MESSAGE_HANDLER(ViewHostMsg_GetCPBrowsingContext, | 215 IPC_MESSAGE_HANDLER(ViewHostMsg_GetCPBrowsingContext, |
218 OnGetCPBrowsingContext) | 216 OnGetCPBrowsingContext) |
219 IPC_MESSAGE_HANDLER(ViewHostMsg_DuplicateSection, OnDuplicateSection) | 217 IPC_MESSAGE_HANDLER(ViewHostMsg_DuplicateSection, OnDuplicateSection) |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 | 532 |
535 void ResourceMessageFilter::OnGetRootWindowRect(gfx::NativeViewId window_id, | 533 void ResourceMessageFilter::OnGetRootWindowRect(gfx::NativeViewId window_id, |
536 gfx::Rect* rect) { | 534 gfx::Rect* rect) { |
537 HWND window = gfx::NativeViewFromId(window_id); | 535 HWND window = gfx::NativeViewFromId(window_id); |
538 RECT window_rect = {0}; | 536 RECT window_rect = {0}; |
539 HWND root_window = ::GetAncestor(window, GA_ROOT); | 537 HWND root_window = ::GetAncestor(window, GA_ROOT); |
540 GetWindowRect(root_window, &window_rect); | 538 GetWindowRect(root_window, &window_rect); |
541 *rect = window_rect; | 539 *rect = window_rect; |
542 } | 540 } |
543 | 541 |
544 void ResourceMessageFilter::OnGetRootWindowResizerRect(gfx::NativeViewId window, | |
545 gfx::Rect* rect) { | |
546 RECT window_rect = {0}; | |
547 *rect = window_rect; | |
548 } | |
549 | |
550 #endif // OS_WIN | 542 #endif // OS_WIN |
551 | 543 |
552 void ResourceMessageFilter::OnGetMimeTypeFromExtension( | 544 void ResourceMessageFilter::OnGetMimeTypeFromExtension( |
553 const std::wstring& ext, std::string* mime_type) { | 545 const std::wstring& ext, std::string* mime_type) { |
554 net::GetMimeTypeFromExtension(ext, mime_type); | 546 net::GetMimeTypeFromExtension(ext, mime_type); |
555 } | 547 } |
556 | 548 |
557 void ResourceMessageFilter::OnGetMimeTypeFromFile( | 549 void ResourceMessageFilter::OnGetMimeTypeFromFile( |
558 const std::wstring& file_path, std::string* mime_type) { | 550 const std::wstring& file_path, std::string* mime_type) { |
559 net::GetMimeTypeFromFile(file_path, mime_type); | 551 net::GetMimeTypeFromFile(file_path, mime_type); |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 if (type == NotificationType::SPELLCHECKER_REINITIALIZED) { | 741 if (type == NotificationType::SPELLCHECKER_REINITIALIZED) { |
750 spellchecker_ = Details<SpellcheckerReinitializedDetails> | 742 spellchecker_ = Details<SpellcheckerReinitializedDetails> |
751 (details).ptr()->spellchecker; | 743 (details).ptr()->spellchecker; |
752 } | 744 } |
753 } | 745 } |
754 | 746 |
755 void ResourceMessageFilter::OnDnsPrefetch( | 747 void ResourceMessageFilter::OnDnsPrefetch( |
756 const std::vector<std::string>& hostnames) { | 748 const std::vector<std::string>& hostnames) { |
757 chrome_browser_net::DnsPrefetchList(hostnames); | 749 chrome_browser_net::DnsPrefetchList(hostnames); |
758 } | 750 } |
OLD | NEW |