| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/webui/constrained_html_ui.h" | 5 #include "chrome/browser/ui/webui/constrained_html_ui.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "base/memory/scoped_nsobject.h" | 9 #include "base/memory/scoped_nsobject.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 new TabContents(profile, NULL, MSG_ROUTING_NONE, NULL, NULL); | 99 new TabContents(profile, NULL, MSG_ROUTING_NONE, NULL, NULL); |
| 100 tab_.reset(new TabContentsWrapper(tab_contents)); | 100 tab_.reset(new TabContentsWrapper(tab_contents)); |
| 101 tab_contents->set_delegate(this); | 101 tab_contents->set_delegate(this); |
| 102 | 102 |
| 103 // Set |this| as a property on the tab contents so that the ConstrainedHtmlUI | 103 // Set |this| as a property on the tab contents so that the ConstrainedHtmlUI |
| 104 // can get a reference to |this|. | 104 // can get a reference to |this|. |
| 105 ConstrainedHtmlUI::GetPropertyAccessor().SetProperty( | 105 ConstrainedHtmlUI::GetPropertyAccessor().SetProperty( |
| 106 tab_contents->property_bag(), this); | 106 tab_contents->property_bag(), this); |
| 107 | 107 |
| 108 tab_contents->controller().LoadURL(delegate->GetDialogContentURL(), | 108 tab_contents->controller().LoadURL(delegate->GetDialogContentURL(), |
| 109 GURL(), | 109 content::Referrer(), |
| 110 content::PAGE_TRANSITION_START_PAGE, | 110 content::PAGE_TRANSITION_START_PAGE, |
| 111 std::string()); | 111 std::string()); |
| 112 | 112 |
| 113 // Create NSWindow to hold tab_contents in the constrained sheet: | 113 // Create NSWindow to hold tab_contents in the constrained sheet: |
| 114 gfx::Size size; | 114 gfx::Size size; |
| 115 delegate->GetDialogSize(&size); | 115 delegate->GetDialogSize(&size); |
| 116 NSRect frame = NSMakeRect(0, 0, size.width(), size.height()); | 116 NSRect frame = NSMakeRect(0, 0, size.width(), size.height()); |
| 117 | 117 |
| 118 // |window| is retained by the ConstrainedWindowMacDelegateCustomSheet when | 118 // |window| is retained by the ConstrainedWindowMacDelegateCustomSheet when |
| 119 // the sheet is initialized. | 119 // the sheet is initialized. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 return self; | 173 return self; |
| 174 } | 174 } |
| 175 | 175 |
| 176 - (void)sheetDidEnd:(NSWindow*)sheet | 176 - (void)sheetDidEnd:(NSWindow*)sheet |
| 177 returnCode:(int)returnCode | 177 returnCode:(int)returnCode |
| 178 contextInfo:(void *)contextInfo { | 178 contextInfo:(void *)contextInfo { |
| 179 [sheet orderOut:self]; | 179 [sheet orderOut:self]; |
| 180 } | 180 } |
| 181 | 181 |
| 182 @end | 182 @end |
| OLD | NEW |