OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/android/data_usage/data_use_ui_tab_model.h" | 5 #include "chrome/browser/android/data_usage/data_use_ui_tab_model.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
175 DCHECK(thread_checker_.CalledOnValidThread()); | 175 DCHECK(thread_checker_.CalledOnValidThread()); |
176 | 176 |
177 TabEvents::const_iterator it = tab_events_.find(tab_id); | 177 TabEvents::const_iterator it = tab_events_.find(tab_id); |
178 | 178 |
179 if (it != tab_events_.end() && it->second == DATA_USE_CONTINUE_CLICKED) | 179 if (it != tab_events_.end() && it->second == DATA_USE_CONTINUE_CLICKED) |
180 return false; | 180 return false; |
181 | 181 |
182 DataUseTabModel::TransitionType transition_type; | 182 DataUseTabModel::TransitionType transition_type; |
183 | 183 |
184 if (!ConvertTransitionType(ui::PageTransitionFromInt(page_transition), | 184 if (!ConvertTransitionType(ui::PageTransitionFromInt(page_transition), |
185 GURL(url), &transition_type)) { | 185 GURL(url), &transition_type)) { |
Charlie Harrison
2016/11/09 21:12:58
Note that we GURL(url) here. Let's just use that,
cfredric
2016/11/09 22:12:46
Done.
| |
186 return false; | 186 return false; |
187 } | 187 } |
188 | 188 |
189 if (transition_type != DataUseTabModel::TRANSITION_FORWARD_BACK) { | 189 if (transition_type != DataUseTabModel::TRANSITION_FORWARD_BACK) { |
190 // NavigationEntry is only needed for back-forward navigations. For other | 190 // NavigationEntry is only needed for back-forward navigations. For other |
191 // navigations, such as redirects, NavigationEntry may not correspond to the | 191 // navigations, such as redirects, NavigationEntry may not correspond to the |
192 // current navigation. | 192 // current navigation. |
193 navigation_entry = nullptr; | 193 navigation_entry = nullptr; |
194 } | 194 } |
195 DCHECK(!navigation_entry || (navigation_entry->GetURL() == GURL(url))); | 195 DCHECK(!navigation_entry || (navigation_entry->GetURL() == url)); |
esprehn
2016/11/09 21:09:25
why don't we need to canonicalize url?
cfredric
2016/11/09 22:12:46
I'm not sure that we don't. Changed back.
| |
196 | 196 |
197 if (!data_use_tab_model_) | 197 if (!data_use_tab_model_) |
198 return false; | 198 return false; |
199 | 199 |
200 return data_use_tab_model_->WouldNavigationEventEndTracking( | 200 return data_use_tab_model_->WouldNavigationEventEndTracking( |
201 tab_id, transition_type, GURL(url), navigation_entry); | 201 tab_id, transition_type, GURL(url), navigation_entry); |
202 } | 202 } |
203 | 203 |
204 void DataUseUITabModel::UserClickedContinueOnDialogBox( | 204 void DataUseUITabModel::UserClickedContinueOnDialogBox( |
205 SessionID::id_type tab_id) { | 205 SessionID::id_type tab_id) { |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
344 data_use_tab_model_->OnNavigationEvent( | 344 data_use_tab_model_->OnNavigationEvent( |
345 ui_event.tab_id, ui_event.transition_type, ui_event.url, | 345 ui_event.tab_id, ui_event.transition_type, ui_event.url, |
346 ui_event.package, nullptr); | 346 ui_event.package, nullptr); |
347 } | 347 } |
348 } | 348 } |
349 } | 349 } |
350 | 350 |
351 } // namespace android | 351 } // namespace android |
352 | 352 |
353 } // namespace chrome | 353 } // namespace chrome |
OLD | NEW |