OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/web_dialog_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/web_dialog_window_controller.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
10 #import "chrome/browser/ui/browser_dialogs.h" | 10 #import "chrome/browser/ui/browser_dialogs.h" |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 [[self window] setContentView:webContents_->GetNativeView()]; | 346 [[self window] setContentView:webContents_->GetNativeView()]; |
347 webContents_->SetDelegate(delegate_.get()); | 347 webContents_->SetDelegate(delegate_.get()); |
348 | 348 |
349 // This must be done before loading the page; see the comments in | 349 // This must be done before loading the page; see the comments in |
350 // WebDialogUI. | 350 // WebDialogUI. |
351 WebDialogUI::SetDelegate(webContents_.get(), delegate_.get()); | 351 WebDialogUI::SetDelegate(webContents_.get(), delegate_.get()); |
352 | 352 |
353 webContents_->GetController().LoadURL( | 353 webContents_->GetController().LoadURL( |
354 delegate_->GetDialogContentURL(), | 354 delegate_->GetDialogContentURL(), |
355 content::Referrer(), | 355 content::Referrer(), |
356 content::PAGE_TRANSITION_AUTO_TOPLEVEL, | 356 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
357 std::string()); | 357 std::string()); |
358 | 358 |
359 // TODO(akalin): add accelerator for ESC to close the dialog box. | 359 // TODO(akalin): add accelerator for ESC to close the dialog box. |
360 // | 360 // |
361 // TODO(akalin): Figure out why implementing (void)cancel:(id)sender | 361 // TODO(akalin): Figure out why implementing (void)cancel:(id)sender |
362 // to do the above doesn't work. | 362 // to do the above doesn't work. |
363 } | 363 } |
364 | 364 |
365 - (void)windowWillClose:(NSNotification*)notification { | 365 - (void)windowWillClose:(NSNotification*)notification { |
366 delegate_->WindowControllerClosed(); | 366 delegate_->WindowControllerClosed(); |
367 [self autorelease]; | 367 [self autorelease]; |
368 } | 368 } |
369 | 369 |
370 @end | 370 @end |
OLD | NEW |