OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/google/core/browser/google_url_tracker_infobar_delegate.h" | 5 #include "components/google/core/browser/google_url_tracker_infobar_delegate.h" |
6 | 6 |
7 #include "components/google/core/browser/google_url_tracker.h" | 7 #include "components/google/core/browser/google_url_tracker.h" |
8 #include "components/google/core/browser/google_url_tracker_navigation_helper.h" | 8 #include "components/google/core/browser/google_url_tracker_navigation_helper.h" |
9 #include "components/infobars/core/infobar.h" | 9 #include "components/infobars/core/infobar.h" |
10 #include "components/infobars/core/infobar_manager.h" | 10 #include "components/infobars/core/infobar_manager.h" |
11 #include "grit/components_strings.h" | 11 #include "grit/components_strings.h" |
12 #include "net/base/net_util.h" | 12 #include "net/base/net_util.h" |
13 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
14 | 14 |
15 | 15 |
16 // static | 16 // static |
17 infobars::InfoBar* GoogleURLTrackerInfoBarDelegate::Create( | 17 infobars::InfoBar* GoogleURLTrackerInfoBarDelegate::Create( |
18 infobars::InfoBarManager* infobar_manager, | 18 infobars::InfoBarManager* infobar_manager, |
19 GoogleURLTracker* google_url_tracker, | 19 GoogleURLTracker* google_url_tracker, |
20 const GURL& search_url) { | 20 const GURL& search_url) { |
21 return infobar_manager->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( | 21 return infobar_manager->AddInfoBar(infobar_manager->CreateConfirmInfoBar( |
22 scoped_ptr<ConfirmInfoBarDelegate>(new GoogleURLTrackerInfoBarDelegate( | 22 scoped_ptr<ConfirmInfoBarDelegate>(new GoogleURLTrackerInfoBarDelegate( |
23 google_url_tracker, search_url)))); | 23 google_url_tracker, search_url)))); |
24 } | 24 } |
25 | 25 |
26 bool GoogleURLTrackerInfoBarDelegate::Accept() { | 26 bool GoogleURLTrackerInfoBarDelegate::Accept() { |
27 google_url_tracker_->AcceptGoogleURL(true); | 27 google_url_tracker_->AcceptGoogleURL(true); |
28 return false; | 28 return false; |
29 } | 29 } |
30 | 30 |
31 bool GoogleURLTrackerInfoBarDelegate::Cancel() { | 31 bool GoogleURLTrackerInfoBarDelegate::Cancel() { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 110 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
111 true); | 111 true); |
112 return false; | 112 return false; |
113 } | 113 } |
114 | 114 |
115 bool GoogleURLTrackerInfoBarDelegate::ShouldExpireInternal( | 115 bool GoogleURLTrackerInfoBarDelegate::ShouldExpireInternal( |
116 const NavigationDetails& details) const { | 116 const NavigationDetails& details) const { |
117 return (details.entry_id != contents_unique_id()) && | 117 return (details.entry_id != contents_unique_id()) && |
118 (details.entry_id != pending_id_); | 118 (details.entry_id != pending_id_); |
119 } | 119 } |
OLD | NEW |