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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 constrained_window_(NULL), | 85 constrained_window_(NULL), |
86 closed_via_webui_(false) { | 86 closed_via_webui_(false) { |
87 tab_contents_.set_delegate(this); | 87 tab_contents_.set_delegate(this); |
88 | 88 |
89 // Set |this| as a property on the tab contents so that the ConstrainedHtmlUI | 89 // Set |this| as a property on the tab contents so that the ConstrainedHtmlUI |
90 // can get a reference to |this|. | 90 // can get a reference to |this|. |
91 ConstrainedHtmlUI::GetPropertyAccessor().SetProperty( | 91 ConstrainedHtmlUI::GetPropertyAccessor().SetProperty( |
92 tab_contents_.property_bag(), this); | 92 tab_contents_.property_bag(), this); |
93 | 93 |
94 tab_contents_.controller().LoadURL(delegate->GetDialogContentURL(), | 94 tab_contents_.controller().LoadURL(delegate->GetDialogContentURL(), |
95 GURL(), PageTransition::START_PAGE, | 95 GURL(), |
| 96 content::PAGE_TRANSITION_START_PAGE, |
96 std::string()); | 97 std::string()); |
97 | 98 |
98 // Create NSWindow to hold tab_contents in the constrained sheet: | 99 // Create NSWindow to hold tab_contents in the constrained sheet: |
99 gfx::Size size; | 100 gfx::Size size; |
100 delegate->GetDialogSize(&size); | 101 delegate->GetDialogSize(&size); |
101 NSRect frame = NSMakeRect(0, 0, size.width(), size.height()); | 102 NSRect frame = NSMakeRect(0, 0, size.width(), size.height()); |
102 | 103 |
103 // |window| is retained by the ConstrainedWindowMacDelegateCustomSheet when | 104 // |window| is retained by the ConstrainedWindowMacDelegateCustomSheet when |
104 // the sheet is initialized. | 105 // the sheet is initialized. |
105 scoped_nsobject<NSWindow> window; | 106 scoped_nsobject<NSWindow> window; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 return self; | 155 return self; |
155 } | 156 } |
156 | 157 |
157 - (void)sheetDidEnd:(NSWindow*)sheet | 158 - (void)sheetDidEnd:(NSWindow*)sheet |
158 returnCode:(int)returnCode | 159 returnCode:(int)returnCode |
159 contextInfo:(void *)contextInfo { | 160 contextInfo:(void *)contextInfo { |
160 [sheet orderOut:self]; | 161 [sheet orderOut:self]; |
161 } | 162 } |
162 | 163 |
163 @end | 164 @end |
OLD | NEW |