Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6913)

Unified Diff: chrome/browser/ui/cocoa/html_dialog_window_controller.mm

Issue 9225053: Add a blocking version of the sync promo dialog (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/html_dialog_window_controller.mm
diff --git a/chrome/browser/ui/cocoa/html_dialog_window_controller.mm b/chrome/browser/ui/cocoa/html_dialog_window_controller.mm
index f57af531529ade0ebf872533d34060bd248e750f..02304d93c872203daa1ea3f16717cd022bb26dc4 100644
--- a/chrome/browser/ui/cocoa/html_dialog_window_controller.mm
+++ b/chrome/browser/ui/cocoa/html_dialog_window_controller.mm
@@ -61,6 +61,14 @@ public:
virtual void MoveContents(WebContents* source, const gfx::Rect& pos);
virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event);
virtual void CloseContents(WebContents* source) OVERRIDE;
+ virtual content::WebContents* OpenURLFromTab(
+ content::WebContents* source,
+ const content::OpenURLParams& params) OVERRIDE;
+ virtual void AddNewContents(content::WebContents* source,
+ content::WebContents* new_contents,
+ WindowOpenDisposition disposition,
+ const gfx::Rect& initial_pos,
+ bool user_gesture) OVERRIDE;
private:
HtmlDialogWindowController* controller_; // weak
@@ -97,6 +105,10 @@ gfx::NativeWindow ShowHtmlDialog(gfx::NativeWindow parent,
browser:browser];
}
+void CloseHtmlDialog(gfx::NativeWindow window) {
+ [window performClose:nil];
+}
+
} // namespace html_dialog_window_controller
HtmlDialogWindowDelegateBridge::HtmlDialogWindowDelegateBridge(
@@ -200,6 +212,31 @@ void HtmlDialogWindowDelegateBridge::CloseContents(WebContents* source) {
OnDialogClosed(std::string());
}
+content::WebContents* HtmlDialogWindowDelegateBridge::OpenURLFromTab(
+ content::WebContents* source,
+ const content::OpenURLParams& params) {
+ content::WebContents* new_contents = NULL;
+ if (delegate_ &&
+ delegate_->HandleOpenURLFromTab(source, params, &new_contents)) {
+ return new_contents;
+ }
+ return HtmlDialogTabContentsDelegate::OpenURLFromTab(source, params);
+}
+
+void HtmlDialogWindowDelegateBridge::AddNewContents(
+ content::WebContents* source,
+ content::WebContents* new_contents,
+ WindowOpenDisposition disposition,
+ const gfx::Rect& initial_pos,
+ bool user_gesture) {
+ if (delegate_ && delegate_->HandlerAddNewContents(
+ source, new_contents, disposition, initial_pos, user_gesture)) {
+ return;
+ }
+ HtmlDialogTabContentsDelegate::AddNewContents(
+ source, new_contents, disposition, initial_pos, user_gesture);
+}
+
void HtmlDialogWindowDelegateBridge::MoveContents(WebContents* source,
const gfx::Rect& pos) {
// TODO(akalin): Actually set the window bounds.

Powered by Google App Engine
This is Rietveld 408576698