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 #import "chrome/browser/ui/cocoa/html_dialog_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/html_dialog_window_controller.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_nsobject.h" | 8 #include "base/memory/scoped_nsobject.h" |
9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 delegate_->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL)); | 290 delegate_->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL)); |
291 [[self window] setContentView:tabContents_->GetNativeView()]; | 291 [[self window] setContentView:tabContents_->GetNativeView()]; |
292 tabContents_->set_delegate(delegate_.get()); | 292 tabContents_->set_delegate(delegate_.get()); |
293 | 293 |
294 // This must be done before loading the page; see the comments in | 294 // This must be done before loading the page; see the comments in |
295 // HtmlDialogUI. | 295 // HtmlDialogUI. |
296 HtmlDialogUI::GetPropertyAccessor().SetProperty(tabContents_->property_bag(), | 296 HtmlDialogUI::GetPropertyAccessor().SetProperty(tabContents_->property_bag(), |
297 delegate_.get()); | 297 delegate_.get()); |
298 | 298 |
299 tabContents_->controller().LoadURL(delegate_->GetDialogContentURL(), | 299 tabContents_->controller().LoadURL(delegate_->GetDialogContentURL(), |
300 GURL(), | 300 content::Referrer(), |
301 content::PAGE_TRANSITION_START_PAGE, | 301 content::PAGE_TRANSITION_START_PAGE, |
302 std::string()); | 302 std::string()); |
303 | 303 |
304 // TODO(akalin): add accelerator for ESC to close the dialog box. | 304 // TODO(akalin): add accelerator for ESC to close the dialog box. |
305 // | 305 // |
306 // TODO(akalin): Figure out why implementing (void)cancel:(id)sender | 306 // TODO(akalin): Figure out why implementing (void)cancel:(id)sender |
307 // to do the above doesn't work. | 307 // to do the above doesn't work. |
308 } | 308 } |
309 | 309 |
310 - (void)windowWillClose:(NSNotification*)notification { | 310 - (void)windowWillClose:(NSNotification*)notification { |
311 delegate_->WindowControllerClosed(); | 311 delegate_->WindowControllerClosed(); |
312 [self autorelease]; | 312 [self autorelease]; |
313 } | 313 } |
314 | 314 |
315 @end | 315 @end |
OLD | NEW |