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/google/google_url_tracker_infobar_delegate.h" | 5 #include "chrome/browser/google/google_url_tracker_infobar_delegate.h" |
6 | 6 |
7 #include "chrome/browser/google/google_url_tracker.h" | 7 #include "chrome/browser/google/google_url_tracker.h" |
8 #include "chrome/browser/google/google_url_tracker_navigation_helper.h" | 8 #include "chrome/browser/google/google_url_tracker_navigation_helper.h" |
9 #include "chrome/browser/google/google_util.h" | 9 #include "chrome/browser/google/google_util.h" |
10 #include "components/infobars/core/infobar.h" | 10 #include "components/infobars/core/infobar.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 if (new_search_url.is_valid()) | 66 if (new_search_url.is_valid()) |
67 navigation_helper->OpenURL(new_search_url, CURRENT_TAB, false); | 67 navigation_helper->OpenURL(new_search_url, CURRENT_TAB, false); |
68 } | 68 } |
69 | 69 |
70 GoogleURLTrackerInfoBarDelegate::GoogleURLTrackerInfoBarDelegate( | 70 GoogleURLTrackerInfoBarDelegate::GoogleURLTrackerInfoBarDelegate( |
71 GoogleURLTracker* google_url_tracker, | 71 GoogleURLTracker* google_url_tracker, |
72 const GURL& search_url) | 72 const GURL& search_url) |
73 : ConfirmInfoBarDelegate(), | 73 : ConfirmInfoBarDelegate(), |
74 google_url_tracker_(google_url_tracker), | 74 google_url_tracker_(google_url_tracker), |
| 75 navigation_helper_weak_ptr_(NULL), |
75 search_url_(search_url), | 76 search_url_(search_url), |
76 pending_id_(0) { | 77 pending_id_(0) { |
77 } | 78 } |
78 | 79 |
79 GoogleURLTrackerInfoBarDelegate::~GoogleURLTrackerInfoBarDelegate() { | 80 GoogleURLTrackerInfoBarDelegate::~GoogleURLTrackerInfoBarDelegate() { |
80 } | 81 } |
81 | 82 |
82 base::string16 GoogleURLTrackerInfoBarDelegate::GetMessageText() const { | 83 base::string16 GoogleURLTrackerInfoBarDelegate::GetMessageText() const { |
83 return l10n_util::GetStringFUTF16( | 84 return l10n_util::GetStringFUTF16( |
84 IDS_GOOGLE_URL_TRACKER_INFOBAR_MESSAGE, | 85 IDS_GOOGLE_URL_TRACKER_INFOBAR_MESSAGE, |
(...skipping 26 matching lines...) Expand all Loading... |
111 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 112 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
112 true); | 113 true); |
113 return false; | 114 return false; |
114 } | 115 } |
115 | 116 |
116 bool GoogleURLTrackerInfoBarDelegate::ShouldExpireInternal( | 117 bool GoogleURLTrackerInfoBarDelegate::ShouldExpireInternal( |
117 const NavigationDetails& details) const { | 118 const NavigationDetails& details) const { |
118 return (details.entry_id != contents_unique_id()) && | 119 return (details.entry_id != contents_unique_id()) && |
119 (details.entry_id != pending_id_); | 120 (details.entry_id != pending_id_); |
120 } | 121 } |
OLD | NEW |