| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/google/google_url_tracker.h" | 5 #include "chrome/browser/google/google_url_tracker.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 google_url_tracker_->AcceptGoogleURL(new_google_url_); | 52 google_url_tracker_->AcceptGoogleURL(new_google_url_); |
| 53 google_url_tracker_->RedoSearch(); | 53 google_url_tracker_->RedoSearch(); |
| 54 return true; | 54 return true; |
| 55 } | 55 } |
| 56 | 56 |
| 57 bool GoogleURLTrackerInfoBarDelegate::Cancel() { | 57 bool GoogleURLTrackerInfoBarDelegate::Cancel() { |
| 58 google_url_tracker_->CancelGoogleURL(new_google_url_); | 58 google_url_tracker_->CancelGoogleURL(new_google_url_); |
| 59 return true; | 59 return true; |
| 60 } | 60 } |
| 61 | 61 |
| 62 void GoogleURLTrackerInfoBarDelegate::InfoBarClosed() { | 62 GoogleURLTrackerInfoBarDelegate::~GoogleURLTrackerInfoBarDelegate() { |
| 63 google_url_tracker_->InfoBarClosed(); | 63 google_url_tracker_->InfoBarClosed(); |
| 64 delete this; | |
| 65 } | |
| 66 | |
| 67 GoogleURLTrackerInfoBarDelegate::~GoogleURLTrackerInfoBarDelegate() { | |
| 68 } | 64 } |
| 69 | 65 |
| 70 string16 GoogleURLTrackerInfoBarDelegate::GetMessageText() const { | 66 string16 GoogleURLTrackerInfoBarDelegate::GetMessageText() const { |
| 71 // TODO(ukai): change new_google_url to google_base_domain? | 67 // TODO(ukai): change new_google_url to google_base_domain? |
| 72 return l10n_util::GetStringFUTF16(IDS_GOOGLE_URL_TRACKER_INFOBAR_MESSAGE, | 68 return l10n_util::GetStringFUTF16(IDS_GOOGLE_URL_TRACKER_INFOBAR_MESSAGE, |
| 73 UTF8ToUTF16(new_google_url_.spec())); | 69 UTF8ToUTF16(new_google_url_.spec())); |
| 74 } | 70 } |
| 75 | 71 |
| 76 string16 GoogleURLTrackerInfoBarDelegate::GetButtonLabel( | 72 string16 GoogleURLTrackerInfoBarDelegate::GetButtonLabel( |
| 77 InfoBarButton button) const { | 73 InfoBarButton button) const { |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 } | 351 } |
| 356 | 352 |
| 357 void GoogleURLTracker::ShowGoogleURLInfoBarIfNecessary( | 353 void GoogleURLTracker::ShowGoogleURLInfoBarIfNecessary( |
| 358 TabContents* tab_contents) { | 354 TabContents* tab_contents) { |
| 359 if (!need_to_prompt_) | 355 if (!need_to_prompt_) |
| 360 return; | 356 return; |
| 361 DCHECK(!fetched_google_url_.is_empty()); | 357 DCHECK(!fetched_google_url_.is_empty()); |
| 362 | 358 |
| 363 infobar_ = (*infobar_creator_)(tab_contents, this, fetched_google_url_); | 359 infobar_ = (*infobar_creator_)(tab_contents, this, fetched_google_url_); |
| 364 } | 360 } |
| OLD | NEW |