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 // This file contains the implementation of TestWebViewDelegate, which serves | 5 // This file contains the implementation of TestWebViewDelegate, which serves |
6 // as the WebViewDelegate for the TestShellWebHost. The host is expected to | 6 // as the WebViewDelegate for the TestShellWebHost. The host is expected to |
7 // have initialized a MessageLoop before these methods are called. | 7 // have initialized a MessageLoop before these methods are called. |
8 | 8 |
9 #include "webkit/tools/test_shell/test_webview_delegate.h" | 9 #include "webkit/tools/test_shell/test_webview_delegate.h" |
10 | 10 |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 | 656 |
657 void TestWebViewDelegate::SetUserStyleSheetLocation(const GURL& location) { | 657 void TestWebViewDelegate::SetUserStyleSheetLocation(const GURL& location) { |
658 WebPreferences* prefs = shell_->GetWebPreferences(); | 658 WebPreferences* prefs = shell_->GetWebPreferences(); |
659 prefs->user_style_sheet_enabled = true; | 659 prefs->user_style_sheet_enabled = true; |
660 prefs->user_style_sheet_location = location; | 660 prefs->user_style_sheet_location = location; |
661 shell_->webView()->SetPreferences(*prefs); | 661 shell_->webView()->SetPreferences(*prefs); |
662 } | 662 } |
663 | 663 |
664 // WebWidgetDelegate --------------------------------------------------------- | 664 // WebWidgetDelegate --------------------------------------------------------- |
665 | 665 |
666 gfx::NativeView TestWebViewDelegate::GetContainingWindow(WebWidget* webwidget) { | 666 gfx::NativeView TestWebViewDelegate::GetContainingView(WebWidget* webwidget) { |
667 if (WebWidgetHost* host = GetHostForWidget(webwidget)) | 667 if (WebWidgetHost* host = GetHostForWidget(webwidget)) |
668 return host->view_handle(); | 668 return host->view_handle(); |
669 | 669 |
670 return NULL; | 670 return NULL; |
671 } | 671 } |
672 | 672 |
673 void TestWebViewDelegate::DidInvalidateRect(WebWidget* webwidget, | 673 void TestWebViewDelegate::DidInvalidateRect(WebWidget* webwidget, |
674 const gfx::Rect& rect) { | 674 const gfx::Rect& rect) { |
675 if (WebWidgetHost* host = GetHostForWidget(webwidget)) | 675 if (WebWidgetHost* host = GetHostForWidget(webwidget)) |
676 host->DidInvalidateRect(rect); | 676 host->DidInvalidateRect(rect); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 else | 825 else |
826 return L"main frame"; | 826 return L"main frame"; |
827 } else { | 827 } else { |
828 if (name.length()) | 828 if (name.length()) |
829 return L"frame \"" + name + L"\""; | 829 return L"frame \"" + name + L"\""; |
830 else | 830 else |
831 return L"frame (anonymous)"; | 831 return L"frame (anonymous)"; |
832 } | 832 } |
833 } | 833 } |
834 | 834 |
OLD | NEW |