Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: components/history/core/browser/history_backend.cc

Issue 2338703003: [NTP] Fix article suggestion clicks contributing to Most Visited tiles (Closed)
Patch Set: Add test coverage to HistoryBackend. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "components/history/core/browser/history_backend.h" 5 #include "components/history/core/browser/history_backend.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <list> 9 #include <list>
10 #include <map> 10 #include <map>
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 // navigation is for the entry google.com transition typed. We end up adding 348 // navigation is for the entry google.com transition typed. We end up adding
349 // a segment for that one as well. So we end up with google.net and google.com 349 // a segment for that one as well. So we end up with google.net and google.com
350 // in the segment table, showing as 2 entries in the NTP. 350 // in the segment table, showing as 2 entries in the NTP.
351 // Note also that we should still be updating the visit count for that segment 351 // Note also that we should still be updating the visit count for that segment
352 // which we are not doing now. It should be addressed when 352 // which we are not doing now. It should be addressed when
353 // http://crbug.com/96860 is fixed. 353 // http://crbug.com/96860 is fixed.
354 if ((ui::PageTransitionCoreTypeIs(transition_type, 354 if ((ui::PageTransitionCoreTypeIs(transition_type,
355 ui::PAGE_TRANSITION_TYPED) || 355 ui::PAGE_TRANSITION_TYPED) ||
356 ui::PageTransitionCoreTypeIs(transition_type, 356 ui::PageTransitionCoreTypeIs(transition_type,
357 ui::PAGE_TRANSITION_AUTO_BOOKMARK)) && 357 ui::PAGE_TRANSITION_AUTO_BOOKMARK)) &&
358 (transition_type & ui::PAGE_TRANSITION_FORWARD_BACK) == 0) { 358 (transition_type & ui::PAGE_TRANSITION_FORWARD_BACK) == 0 &&
359 (transition_type & ui::PAGE_TRANSITION_IGNORE_FOR_NTP_TILES) == 0) {
359 // If so, create or get the segment. 360 // If so, create or get the segment.
360 std::string segment_name = db_->ComputeSegmentName(url); 361 std::string segment_name = db_->ComputeSegmentName(url);
361 URLID url_id = db_->GetRowForURL(url, nullptr); 362 URLID url_id = db_->GetRowForURL(url, nullptr);
362 if (!url_id) 363 if (!url_id)
363 return 0; 364 return 0;
364 365
365 segment_id = db_->GetSegmentNamed(segment_name); 366 segment_id = db_->GetSegmentNamed(segment_name);
366 if (!segment_id) { 367 if (!segment_id) {
367 segment_id = db_->CreateSegment(url_id, segment_name); 368 segment_id = db_->CreateSegment(url_id, segment_name);
368 if (!segment_id) { 369 if (!segment_id) {
(...skipping 2299 matching lines...) Expand 10 before | Expand all | Expand 10 after
2668 // transaction is currently open. 2669 // transaction is currently open.
2669 db_->CommitTransaction(); 2670 db_->CommitTransaction();
2670 db_->Vacuum(); 2671 db_->Vacuum();
2671 db_->BeginTransaction(); 2672 db_->BeginTransaction();
2672 db_->GetStartDate(&first_recorded_time_); 2673 db_->GetStartDate(&first_recorded_time_);
2673 2674
2674 return true; 2675 return true;
2675 } 2676 }
2676 2677
2677 } // namespace history 2678 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698