summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell/mac
diff options
context:
space:
mode:
authorpinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-04 21:53:24 +0000
committerpinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-04 21:53:24 +0000
commit23a3374df8ba981910efafd3f17487b0e323553f (patch)
treef905582bf0ea9d41171d4e2f9e1a5b5432456664 /webkit/tools/test_shell/mac
parentbec0b3244315aac937842bbb649530b6a3e70ed2 (diff)
downloadchromium_src-23a3374df8ba981910efafd3f17487b0e323553f.zip
chromium_src-23a3374df8ba981910efafd3f17487b0e323553f.tar.gz
chromium_src-23a3374df8ba981910efafd3f17487b0e323553f.tar.bz2
make it easier to type urls into testshell by adding http if there's no scheme
Review URL: http://codereview.chromium.org/9138 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4672 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/mac')
-rw-r--r--webkit/tools/test_shell/mac/test_shell_webview.mm8
1 files changed, 6 insertions, 2 deletions
diff --git a/webkit/tools/test_shell/mac/test_shell_webview.mm b/webkit/tools/test_shell/mac/test_shell_webview.mm
index d764d66..f0b28ef 100644
--- a/webkit/tools/test_shell/mac/test_shell_webview.mm
+++ b/webkit/tools/test_shell/mac/test_shell_webview.mm
@@ -48,8 +48,6 @@
CGContextSetRGBFillColor (context, 1, 0, 1, 1);
CGContextFillRect(context, NSRectToCGRect(rect));
- // uncomment when we stop passing the wrong kinds of GraphicsContext to
- // WebCore
if (shell_ && shell_->webView())
shell_->webViewHost()->Paint();
}
@@ -76,6 +74,12 @@
- (IBAction)takeURLStringValueFrom:(NSTextField *)sender {
NSString *url = [sender stringValue];
+
+ // if it doesn't already have a prefix, add http. If we can't parse it,
+ // just don't bother rather than making things worse.
+ NSURL* tempUrl = [NSURL URLWithString:url];
+ if (tempUrl && ![tempUrl scheme])
+ url = [@"http://" stringByAppendingString:url];
shell_->LoadURL(UTF8ToWide([url UTF8String]).c_str());
}