Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: webkit/tools/test_shell/mac/test_shell_webview.mm

Issue 200054: Hook up WebFrameClient, replacing many WebViewDelegate methods.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #import "test_shell_webview.h" 5 #import "test_shell_webview.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/gfx/rect.h" 9 #include "base/gfx/rect.h"
10 #include "base/scoped_ptr.h" 10 #include "base/scoped_ptr.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 80 }
81 81
82 - (IBAction)takeURLStringValueFrom:(NSTextField *)sender { 82 - (IBAction)takeURLStringValueFrom:(NSTextField *)sender {
83 NSString *url = [sender stringValue]; 83 NSString *url = [sender stringValue];
84 84
85 // if it doesn't already have a prefix, add http. If we can't parse it, 85 // if it doesn't already have a prefix, add http. If we can't parse it,
86 // just don't bother rather than making things worse. 86 // just don't bother rather than making things worse.
87 NSURL* tempUrl = [NSURL URLWithString:url]; 87 NSURL* tempUrl = [NSURL URLWithString:url];
88 if (tempUrl && ![tempUrl scheme]) 88 if (tempUrl && ![tempUrl scheme])
89 url = [@"http://" stringByAppendingString:url]; 89 url = [@"http://" stringByAppendingString:url];
90 shell_->LoadURL(UTF8ToWide([url UTF8String]).c_str()); 90 shell_->LoadURL(GURL(std::string([url UTF8String])));
91 } 91 }
92 92
93 - (void)mouseDown:(NSEvent *)theEvent { 93 - (void)mouseDown:(NSEvent *)theEvent {
94 if (shell_ && shell_->webView()) 94 if (shell_ && shell_->webView())
95 shell_->webViewHost()->MouseEvent(theEvent); 95 shell_->webViewHost()->MouseEvent(theEvent);
96 } 96 }
97 97
98 - (void)rightMouseDown:(NSEvent *)theEvent { 98 - (void)rightMouseDown:(NSEvent *)theEvent {
99 if (shell_ && shell_->webView()) 99 if (shell_ && shell_->webView())
100 shell_->webViewHost()->MouseEvent(theEvent); 100 shell_->webViewHost()->MouseEvent(theEvent);
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 } 196 }
197 197
198 - (void)setFrame:(NSRect)frameRect { 198 - (void)setFrame:(NSRect)frameRect {
199 [super setFrame:frameRect]; 199 [super setFrame:frameRect];
200 if (shell_ && shell_->webView()) 200 if (shell_ && shell_->webView())
201 shell_->webViewHost()->Resize(gfx::Rect(NSRectToCGRect(frameRect))); 201 shell_->webViewHost()->Resize(gfx::Rect(NSRectToCGRect(frameRect)));
202 [self setNeedsDisplay:YES]; 202 [self setNeedsDisplay:YES];
203 } 203 }
204 204
205 @end 205 @end
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/listener_leak_test.cc ('k') | webkit/tools/test_shell/mac/webview_host.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698