| 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" |
| 11 #import "chrome/browser/ui/browser_dialogs.h" | 11 #import "chrome/browser/ui/browser_dialogs.h" |
| 12 #import "chrome/browser/ui/cocoa/browser_command_executor.h" | 12 #import "chrome/browser/ui/cocoa/browser_command_executor.h" |
| 13 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" | 13 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" |
| 14 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 14 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 15 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h" | 15 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h" |
| 16 #include "chrome/browser/ui/webui/web_dialog_web_contents_delegate.h" | |
| 17 #include "content/public/browser/native_web_keyboard_event.h" | 16 #include "content/public/browser/native_web_keyboard_event.h" |
| 18 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
| 19 #include "content/public/browser/web_ui_message_handler.h" | 18 #include "content/public/browser/web_ui_message_handler.h" |
| 20 #include "ui/base/keycodes/keyboard_codes.h" | 19 #include "ui/base/keycodes/keyboard_codes.h" |
| 21 #include "ui/gfx/size.h" | 20 #include "ui/gfx/size.h" |
| 22 #include "ui/web_dialogs/web_dialog_delegate.h" | 21 #include "ui/web_dialogs/web_dialog_delegate.h" |
| 22 #include "ui/web_dialogs/web_dialog_web_contents_delegate.h" |
| 23 | 23 |
| 24 using content::NativeWebKeyboardEvent; | 24 using content::NativeWebKeyboardEvent; |
| 25 using content::WebContents; | 25 using content::WebContents; |
| 26 using content::WebUIMessageHandler; | 26 using content::WebUIMessageHandler; |
| 27 using ui::WebDialogDelegate; | 27 using ui::WebDialogDelegate; |
| 28 using ui::WebDialogUI; | 28 using ui::WebDialogUI; |
| 29 using ui::WebDialogWebContentsDelegate; |
| 29 | 30 |
| 30 // Thin bridge that routes notifications to | 31 // Thin bridge that routes notifications to |
| 31 // WebDialogWindowController's member variables. | 32 // WebDialogWindowController's member variables. |
| 32 class WebDialogWindowDelegateBridge | 33 class WebDialogWindowDelegateBridge |
| 33 : public WebDialogDelegate, | 34 : public WebDialogDelegate, |
| 34 public WebDialogWebContentsDelegate { | 35 public WebDialogWebContentsDelegate { |
| 35 public: | 36 public: |
| 36 // All parameters must be non-NULL/non-nil. | 37 // All parameters must be non-NULL/non-nil. |
| 37 WebDialogWindowDelegateBridge(WebDialogWindowController* controller, | 38 WebDialogWindowDelegateBridge(WebDialogWindowController* controller, |
| 38 content::BrowserContext* context, | 39 content::BrowserContext* context, |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 // TODO(akalin): Figure out why implementing (void)cancel:(id)sender | 358 // TODO(akalin): Figure out why implementing (void)cancel:(id)sender |
| 358 // to do the above doesn't work. | 359 // to do the above doesn't work. |
| 359 } | 360 } |
| 360 | 361 |
| 361 - (void)windowWillClose:(NSNotification*)notification { | 362 - (void)windowWillClose:(NSNotification*)notification { |
| 362 delegate_->WindowControllerClosed(); | 363 delegate_->WindowControllerClosed(); |
| 363 [self autorelease]; | 364 [self autorelease]; |
| 364 } | 365 } |
| 365 | 366 |
| 366 @end | 367 @end |
| OLD | NEW |