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

Side by Side Diff: chrome/browser/alternate_nav_url_fetcher.cc

Issue 11644059: Change infobar creation to use a public static Create() method on the infobar delegate classes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/alternate_nav_url_fetcher.h" 5 #include "chrome/browser/alternate_nav_url_fetcher.h"
6 6
7 #include "chrome/browser/api/infobars/infobar_service.h" 7 #include "chrome/browser/api/infobars/infobar_service.h"
8 #include "chrome/browser/infobars/alternate_nav_infobar_delegate.h" 8 #include "chrome/browser/infobars/alternate_nav_infobar_delegate.h"
9 #include "chrome/browser/intranet_redirect_detector.h" 9 #include "chrome/browser/intranet_redirect_detector.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 // they type. See comments on IntranetRedirectDetector. 135 // they type. See comments on IntranetRedirectDetector.
136 state_ = ((status.status() == net::URLRequestStatus::CANCELED) && 136 state_ = ((status.status() == net::URLRequestStatus::CANCELED) &&
137 ((response_code / 100) == 3) && 137 ((response_code / 100) == 3) &&
138 !net::RegistryControlledDomainService::SameDomainOrHost(url, 138 !net::RegistryControlledDomainService::SameDomainOrHost(url,
139 IntranetRedirectDetector::RedirectOrigin())) ? SUCCEEDED : FAILED; 139 IntranetRedirectDetector::RedirectOrigin())) ? SUCCEEDED : FAILED;
140 } 140 }
141 } 141 }
142 142
143 void AlternateNavURLFetcher::ShowInfobarIfPossible() { 143 void AlternateNavURLFetcher::ShowInfobarIfPossible() {
144 if (navigated_to_entry_ && (state_ == SUCCEEDED)) { 144 if (navigated_to_entry_ && (state_ == SUCCEEDED)) {
145 InfoBarService* infobar_service = 145 AlternateNavInfoBarDelegate::Create(
146 InfoBarService::FromWebContents(controller_->GetWebContents()); 146 InfoBarService::FromWebContents(controller_->GetWebContents()),
147 infobar_service->AddInfoBar( 147 alternate_nav_url_);
148 new AlternateNavInfoBarDelegate(infobar_service, alternate_nav_url_));
149 } else if (state_ != FAILED) { 148 } else if (state_ != FAILED) {
150 return; 149 return;
151 } 150 }
152 delete this; 151 delete this;
153 } 152 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698