| OLD | NEW |
| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 shell_->GoBackOrForward(1); | 69 shell_->GoBackOrForward(1); |
| 70 } | 70 } |
| 71 | 71 |
| 72 - (IBAction)reload:(id)sender { | 72 - (IBAction)reload:(id)sender { |
| 73 if (shell_) | 73 if (shell_) |
| 74 shell_->Reload(); | 74 shell_->Reload(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 - (IBAction)stopLoading:(id)sender { | 77 - (IBAction)stopLoading:(id)sender { |
| 78 if (shell_ && shell_->webView()) | 78 if (shell_ && shell_->webView()) |
| 79 shell_->webView()->StopLoading(); | 79 shell_->webView()->mainFrame()->stopLoading(); |
| 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]; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |