Index: chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc |
=================================================================== |
--- chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc (revision 116011) |
+++ chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc (working copy) |
@@ -21,10 +21,11 @@ |
#include "chrome/common/extensions/extension_constants.h" |
#include "chrome/common/pref_names.h" |
#include "chrome/common/url_constants.h" |
-#include "content/browser/tab_contents/tab_contents.h" |
+#include "content/browser/tab_contents/navigation_controller.h" |
#include "content/public/browser/navigation_entry.h" |
#include "content/public/browser/notification_details.h" |
#include "content/public/browser/notification_service.h" |
+#include "content/public/browser/web_contents.h" |
using content::OpenURLParams; |
using content::Referrer; |
@@ -86,12 +87,12 @@ |
prefs_ = Profile::FromWebUI(web_ui())->GetPrefs(); |
DCHECK(prefs_); |
// Ignore events from view-source:chrome://syncpromo. |
- if (!web_ui()->tab_contents()->GetController().GetActiveEntry()-> |
+ if (!web_ui()->web_contents()->GetController().GetActiveEntry()-> |
IsViewSourceMode()) { |
// Listen to see if the tab we're in gets closed. |
registrar_.Add(this, content::NOTIFICATION_TAB_CLOSING, |
content::Source<NavigationController>( |
- &web_ui()->tab_contents()->GetController())); |
+ &web_ui()->web_contents()->GetController())); |
// Listen to see if the window we're in gets closed. |
registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSING, |
content::NotificationService::AllSources()); |
@@ -163,7 +164,7 @@ |
// Make sure we're in the tab strip of the closing window. |
Browser* browser = content::Source<Browser>(source).ptr(); |
if (browser->tabstrip_model()->GetWrapperIndex( |
- web_ui()->tab_contents()) != TabStripModel::kNoTab) { |
+ web_ui()->web_contents()) != TabStripModel::kNoTab) { |
RecordUserFlowAction(SYNC_PROMO_CLOSED_WINDOW); |
window_already_closed_ = true; |
} |
@@ -199,17 +200,17 @@ |
prefs_->SetBoolean(prefs::kSyncPromoShowNTPBubble, true); |
GURL url = SyncPromoUI::GetNextPageURLForSyncPromoURL( |
- web_ui()->tab_contents()->GetURL()); |
+ web_ui()->web_contents()->GetURL()); |
OpenURLParams params( |
url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_LINK, false); |
- web_ui()->tab_contents()->OpenURL(params); |
+ web_ui()->web_contents()->OpenURL(params); |
} |
void SyncPromoHandler::HandleInitializeSyncPromo(const base::ListValue* args) { |
// If the promo is also the Chrome launch page, we want to show the title and |
// log an event if we are running an experiment. |
bool is_launch_page = SyncPromoUI::GetIsLaunchPageForSyncPromoURL( |
- web_ui()->tab_contents()->GetURL()); |
+ web_ui()->web_contents()->GetURL()); |
if (is_launch_page && sync_promo_trial::IsExperimentActive()) |
sync_promo_trial::RecordUserSawMessage(); |
base::FundamentalValue visible(is_launch_page); |
@@ -234,7 +235,7 @@ |
url += chrome::kSyncSetupSubPage; |
OpenURLParams params( |
GURL(url), Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_LINK, false); |
- web_ui()->tab_contents()->OpenURL(params); |
+ web_ui()->web_contents()->OpenURL(params); |
RecordUserFlowAction(SYNC_PROMO_ADVANCED_CLICKED); |
} |
@@ -287,7 +288,7 @@ |
sync_promo_trial::RecordUserSignedIn(); |
if (sync_promo_trial::IsPartOfBrandTrialToEnable()) { |
bool is_start_up = SyncPromoUI::GetIsLaunchPageForSyncPromoURL( |
- web_ui()->tab_contents()->GetURL()); |
+ web_ui()->web_contents()->GetURL()); |
Profile* profile = Profile::FromWebUI(web_ui()); |
sync_promo_trial::RecordUserSignedInWithTrialBrand(is_start_up, profile); |
} |