| 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 #include "chrome/browser/ui/webui/sync_promo/sync_promo_dialog.h" | 5 #include "chrome/browser/ui/webui/sync_promo/sync_promo_dialog.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "chrome/browser/ui/browser_dialogs.h" | 8 #include "chrome/browser/ui/browser_dialogs.h" |
| 9 #include "chrome/browser/ui/webui/html_dialog_tab_contents_delegate.h" | 9 #include "chrome/browser/ui/webui/html_dialog_tab_contents_delegate.h" |
| 10 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" | 10 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 } | 66 } |
| 67 | 67 |
| 68 void SyncPromoDialog::OnCloseContents(content::WebContents* source, | 68 void SyncPromoDialog::OnCloseContents(content::WebContents* source, |
| 69 bool* out_close_dialog) { | 69 bool* out_close_dialog) { |
| 70 } | 70 } |
| 71 | 71 |
| 72 bool SyncPromoDialog::ShouldShowDialogTitle() const { | 72 bool SyncPromoDialog::ShouldShowDialogTitle() const { |
| 73 return true; | 73 return true; |
| 74 } | 74 } |
| 75 | 75 |
| 76 bool SyncPromoDialog::HandleContextMenu(const ContextMenuParams& params) { | 76 bool SyncPromoDialog::HandleContextMenu( |
| 77 const content::ContextMenuParams& params) { |
| 77 return true; | 78 return true; |
| 78 } | 79 } |
| 79 | 80 |
| 80 bool SyncPromoDialog::HandleOpenURLFromTab( | 81 bool SyncPromoDialog::HandleOpenURLFromTab( |
| 81 content::WebContents* source, | 82 content::WebContents* source, |
| 82 const content::OpenURLParams& params, | 83 const content::OpenURLParams& params, |
| 83 content::WebContents** out_new_contents) { | 84 content::WebContents** out_new_contents) { |
| 84 spawned_browser_ = HtmlDialogTabContentsDelegate::StaticOpenURLFromTab( | 85 spawned_browser_ = HtmlDialogTabContentsDelegate::StaticOpenURLFromTab( |
| 85 profile_, source, params, out_new_contents); | 86 profile_, source, params, out_new_contents); |
| 86 // If the open URL request is for the current tab then that means the sync | 87 // If the open URL request is for the current tab then that means the sync |
| 87 // promo page will be closed. | 88 // promo page will be closed. |
| 88 sync_promo_was_closed_ = params.disposition == CURRENT_TAB; | 89 sync_promo_was_closed_ = params.disposition == CURRENT_TAB; |
| 89 browser::CloseHtmlDialog(window_); | 90 browser::CloseHtmlDialog(window_); |
| 90 return true; | 91 return true; |
| 91 } | 92 } |
| 92 | 93 |
| 93 bool SyncPromoDialog::HandleAddNewContents( | 94 bool SyncPromoDialog::HandleAddNewContents( |
| 94 content::WebContents* source, | 95 content::WebContents* source, |
| 95 content::WebContents* new_contents, | 96 content::WebContents* new_contents, |
| 96 WindowOpenDisposition disposition, | 97 WindowOpenDisposition disposition, |
| 97 const gfx::Rect& initial_pos, | 98 const gfx::Rect& initial_pos, |
| 98 bool user_gesture) { | 99 bool user_gesture) { |
| 99 spawned_browser_ = HtmlDialogTabContentsDelegate::StaticAddNewContents( | 100 spawned_browser_ = HtmlDialogTabContentsDelegate::StaticAddNewContents( |
| 100 profile_, source, new_contents, disposition, initial_pos, user_gesture); | 101 profile_, source, new_contents, disposition, initial_pos, user_gesture); |
| 101 browser::CloseHtmlDialog(window_); | 102 browser::CloseHtmlDialog(window_); |
| 102 return true; | 103 return true; |
| 103 } | 104 } |
| OLD | NEW |