| 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/memory/scoped_nsobject.h" | 8 #include "base/memory/scoped_nsobject.h" |
| 9 #include "base/property_bag.h" | 9 #include "base/property_bag.h" |
| 10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 // ChromeEventProcessingWindow expects its controller to implement the | 87 // ChromeEventProcessingWindow expects its controller to implement the |
| 88 // BrowserCommandExecutor protocol. | 88 // BrowserCommandExecutor protocol. |
| 89 @interface WebDialogWindowController (InternalAPI) <BrowserCommandExecutor> | 89 @interface WebDialogWindowController (InternalAPI) <BrowserCommandExecutor> |
| 90 | 90 |
| 91 // BrowserCommandExecutor methods. | 91 // BrowserCommandExecutor methods. |
| 92 - (void)executeCommand:(int)command; | 92 - (void)executeCommand:(int)command; |
| 93 | 93 |
| 94 @end | 94 @end |
| 95 | 95 |
| 96 namespace browser { | 96 namespace chrome { |
| 97 | 97 |
| 98 gfx::NativeWindow ShowWebDialog(gfx::NativeWindow parent, | 98 gfx::NativeWindow ShowWebDialog(gfx::NativeWindow parent, |
| 99 content::BrowserContext* context, | 99 content::BrowserContext* context, |
| 100 WebDialogDelegate* delegate) { | 100 WebDialogDelegate* delegate) { |
| 101 return [WebDialogWindowController showWebDialog:delegate | 101 return [WebDialogWindowController showWebDialog:delegate |
| 102 context:context]; | 102 context:context]; |
| 103 } | 103 } |
| 104 | 104 |
| 105 } // namespace browser | 105 } // namespace chrome |
| 106 | 106 |
| 107 WebDialogWindowDelegateBridge::WebDialogWindowDelegateBridge( | 107 WebDialogWindowDelegateBridge::WebDialogWindowDelegateBridge( |
| 108 WebDialogWindowController* controller, | 108 WebDialogWindowController* controller, |
| 109 content::BrowserContext* context, | 109 content::BrowserContext* context, |
| 110 WebDialogDelegate* delegate) | 110 WebDialogDelegate* delegate) |
| 111 : WebDialogWebContentsDelegate(context), | 111 : WebDialogWebContentsDelegate(context), |
| 112 controller_(controller), | 112 controller_(controller), |
| 113 delegate_(delegate) { | 113 delegate_(delegate) { |
| 114 DCHECK(controller_); | 114 DCHECK(controller_); |
| 115 DCHECK(delegate_); | 115 DCHECK(delegate_); |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 // TODO(akalin): Figure out why implementing (void)cancel:(id)sender | 357 // TODO(akalin): Figure out why implementing (void)cancel:(id)sender |
| 358 // to do the above doesn't work. | 358 // to do the above doesn't work. |
| 359 } | 359 } |
| 360 | 360 |
| 361 - (void)windowWillClose:(NSNotification*)notification { | 361 - (void)windowWillClose:(NSNotification*)notification { |
| 362 delegate_->WindowControllerClosed(); | 362 delegate_->WindowControllerClosed(); |
| 363 [self autorelease]; | 363 [self autorelease]; |
| 364 } | 364 } |
| 365 | 365 |
| 366 @end | 366 @end |
| OLD | NEW |