| 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 "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 GoogleURLTrackerInfoBarDelegate::~GoogleURLTrackerInfoBarDelegate() { | 67 GoogleURLTrackerInfoBarDelegate::~GoogleURLTrackerInfoBarDelegate() { |
| 68 } | 68 } |
| 69 | 69 |
| 70 string16 GoogleURLTrackerInfoBarDelegate::GetMessageText() const { | 70 string16 GoogleURLTrackerInfoBarDelegate::GetMessageText() const { |
| 71 // TODO(ukai): change new_google_url to google_base_domain? | 71 // TODO(ukai): change new_google_url to google_base_domain? |
| 72 return l10n_util::GetStringFUTF16(IDS_GOOGLE_URL_TRACKER_INFOBAR_MESSAGE, | 72 return l10n_util::GetStringFUTF16(IDS_GOOGLE_URL_TRACKER_INFOBAR_MESSAGE, |
| 73 UTF8ToUTF16(new_google_url_.spec())); | 73 UTF8ToUTF16(new_google_url_.spec())); |
| 74 } | 74 } |
| 75 | 75 |
| 76 int GoogleURLTrackerInfoBarDelegate::GetButtons() const { | |
| 77 return BUTTON_OK | BUTTON_CANCEL; | |
| 78 } | |
| 79 | |
| 80 string16 GoogleURLTrackerInfoBarDelegate::GetButtonLabel( | 76 string16 GoogleURLTrackerInfoBarDelegate::GetButtonLabel( |
| 81 InfoBarButton button) const { | 77 InfoBarButton button) const { |
| 82 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? | 78 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? |
| 83 IDS_CONFIRM_MESSAGEBOX_YES_BUTTON_LABEL : | 79 IDS_CONFIRM_MESSAGEBOX_YES_BUTTON_LABEL : |
| 84 IDS_CONFIRM_MESSAGEBOX_NO_BUTTON_LABEL); | 80 IDS_CONFIRM_MESSAGEBOX_NO_BUTTON_LABEL); |
| 85 } | 81 } |
| 86 | 82 |
| 87 | 83 |
| 88 // GoogleURLTracker ----------------------------------------------------------- | 84 // GoogleURLTracker ----------------------------------------------------------- |
| 89 | 85 |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 } | 367 } |
| 372 | 368 |
| 373 void GoogleURLTracker::ShowGoogleURLInfoBarIfNecessary( | 369 void GoogleURLTracker::ShowGoogleURLInfoBarIfNecessary( |
| 374 TabContents* tab_contents) { | 370 TabContents* tab_contents) { |
| 375 if (!need_to_prompt_) | 371 if (!need_to_prompt_) |
| 376 return; | 372 return; |
| 377 DCHECK(!fetched_google_url_.is_empty()); | 373 DCHECK(!fetched_google_url_.is_empty()); |
| 378 | 374 |
| 379 infobar_ = (*infobar_creator_)(tab_contents, this, fetched_google_url_); | 375 infobar_ = (*infobar_creator_)(tab_contents, this, fetched_google_url_); |
| 380 } | 376 } |
| OLD | NEW |