| 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 delegate_->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL)); | 280 delegate_->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL)); |
| 281 [[self window] setContentView:tabContents_->GetNativeView()]; | 281 [[self window] setContentView:tabContents_->GetNativeView()]; |
| 282 tabContents_->set_delegate(delegate_.get()); | 282 tabContents_->set_delegate(delegate_.get()); |
| 283 | 283 |
| 284 // This must be done before loading the page; see the comments in | 284 // This must be done before loading the page; see the comments in |
| 285 // HtmlDialogUI. | 285 // HtmlDialogUI. |
| 286 HtmlDialogUI::GetPropertyAccessor().SetProperty(tabContents_->property_bag(), | 286 HtmlDialogUI::GetPropertyAccessor().SetProperty(tabContents_->property_bag(), |
| 287 delegate_.get()); | 287 delegate_.get()); |
| 288 | 288 |
| 289 tabContents_->controller().LoadURL(delegate_->GetDialogContentURL(), | 289 tabContents_->controller().LoadURL(delegate_->GetDialogContentURL(), |
| 290 GURL(), PageTransition::START_PAGE, | 290 GURL(), |
| 291 content::PAGE_TRANSITION_START_PAGE, |
| 291 std::string()); | 292 std::string()); |
| 292 | 293 |
| 293 // TODO(akalin): add accelerator for ESC to close the dialog box. | 294 // TODO(akalin): add accelerator for ESC to close the dialog box. |
| 294 // | 295 // |
| 295 // TODO(akalin): Figure out why implementing (void)cancel:(id)sender | 296 // TODO(akalin): Figure out why implementing (void)cancel:(id)sender |
| 296 // to do the above doesn't work. | 297 // to do the above doesn't work. |
| 297 } | 298 } |
| 298 | 299 |
| 299 - (void)windowWillClose:(NSNotification*)notification { | 300 - (void)windowWillClose:(NSNotification*)notification { |
| 300 delegate_->WindowControllerClosed(); | 301 delegate_->WindowControllerClosed(); |
| 301 [self autorelease]; | 302 [self autorelease]; |
| 302 } | 303 } |
| 303 | 304 |
| 304 @end | 305 @end |
| OLD | NEW |