summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/ui/cocoa/html_dialog_window_controller.h4
-rw-r--r--chrome/browser/ui/cocoa/html_dialog_window_controller.mm17
2 files changed, 12 insertions, 9 deletions
diff --git a/chrome/browser/ui/cocoa/html_dialog_window_controller.h b/chrome/browser/ui/cocoa/html_dialog_window_controller.h
index c0a1d6e..2ba46a5 100644
--- a/chrome/browser/ui/cocoa/html_dialog_window_controller.h
+++ b/chrome/browser/ui/cocoa/html_dialog_window_controller.h
@@ -15,7 +15,7 @@
class HtmlDialogWindowDelegateBridge;
class Profile;
-class TabContents;
+class TabContentsWrapper;
// This controller manages a dialog box with properties and HTML content taken
// from a HTMLDialogUIDelegate object.
@@ -24,7 +24,7 @@ class TabContents;
// Order here is important, as tab_contents_ may send messages to
// delegate_ when it gets destroyed.
scoped_ptr<HtmlDialogWindowDelegateBridge> delegate_;
- scoped_ptr<TabContents> tabContents_;
+ scoped_ptr<TabContentsWrapper> contentsWrapper_;
}
// Creates and shows an HtmlDialogWindowController with the given
diff --git a/chrome/browser/ui/cocoa/html_dialog_window_controller.mm b/chrome/browser/ui/cocoa/html_dialog_window_controller.mm
index 1849744..46e491e 100644
--- a/chrome/browser/ui/cocoa/html_dialog_window_controller.mm
+++ b/chrome/browser/ui/cocoa/html_dialog_window_controller.mm
@@ -12,6 +12,7 @@
#import "chrome/browser/ui/cocoa/browser_command_executor.h"
#import "chrome/browser/ui/cocoa/chrome_event_processing_window.h"
#include "chrome/browser/ui/dialog_style.h"
+#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/browser/ui/webui/html_dialog_tab_contents_delegate.h"
#include "chrome/browser/ui/webui/html_dialog_ui.h"
#include "content/browser/tab_contents/tab_contents.h"
@@ -286,17 +287,19 @@ void HtmlDialogWindowDelegateBridge::HandleKeyboardEvent(
}
- (void)loadDialogContents {
- tabContents_.reset(new TabContents(
- delegate_->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL));
- [[self window] setContentView:tabContents_->GetNativeView()];
- tabContents_->set_delegate(delegate_.get());
+ contentsWrapper_.reset(new TabContentsWrapper(new TabContents(
+ delegate_->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL)));
+ [[self window]
+ setContentView:contentsWrapper_->tab_contents()->GetNativeView()];
+ contentsWrapper_->tab_contents()->set_delegate(delegate_.get());
// This must be done before loading the page; see the comments in
// HtmlDialogUI.
- HtmlDialogUI::GetPropertyAccessor().SetProperty(tabContents_->property_bag(),
- delegate_.get());
+ HtmlDialogUI::GetPropertyAccessor().SetProperty(
+ contentsWrapper_->tab_contents()->property_bag(), delegate_.get());
- tabContents_->controller().LoadURL(delegate_->GetDialogContentURL(),
+ contentsWrapper_->tab_contents()->controller().LoadURL(
+ delegate_->GetDialogContentURL(),
content::Referrer(),
content::PAGE_TRANSITION_START_PAGE,
std::string());