| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "chrome/browser/dom_ui/new_tab_ui.h" | 7 #include "chrome/browser/dom_ui/new_tab_ui.h" |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 // We count all link clicks as AUTO_BOOKMARK, so that site can be ranked more | 475 // We count all link clicks as AUTO_BOOKMARK, so that site can be ranked more |
| 476 // highly. Note this means we're including clicks on not only most visited | 476 // highly. Note this means we're including clicks on not only most visited |
| 477 // thumbnails, but also clicks on recently bookmarked. | 477 // thumbnails, but also clicks on recently bookmarked. |
| 478 link_transition_type_ = PageTransition::AUTO_BOOKMARK; | 478 link_transition_type_ = PageTransition::AUTO_BOOKMARK; |
| 479 | 479 |
| 480 if (NewTabUI::FirstRunDisabled()) | 480 if (NewTabUI::FirstRunDisabled()) |
| 481 NewTabHTMLSource::set_first_run(false); | 481 NewTabHTMLSource::set_first_run(false); |
| 482 | 482 |
| 483 static bool first_view = true; | 483 static bool first_view = true; |
| 484 if (first_view) { | 484 if (first_view) { |
| 485 Profile* profile = GetProfile(); |
| 485 // Decrement ntp promo counters; the default values are specified in | 486 // Decrement ntp promo counters; the default values are specified in |
| 486 // Browser::RegisterUserPrefs. | 487 // Browser::RegisterUserPrefs. |
| 487 profile->GetPrefs()->SetInteger(prefs::kNTPPromoLineRemaining, | 488 profile->GetPrefs()->SetInteger(prefs::kNTPPromoLineRemaining, |
| 488 profile->GetPrefs()->GetInteger(prefs::kNTPPromoLineRemaining) - 1); | 489 profile->GetPrefs()->GetInteger(prefs::kNTPPromoLineRemaining) - 1); |
| 489 profile->GetPrefs()->SetInteger(prefs::kNTPPromoImageRemaining, | 490 profile->GetPrefs()->SetInteger(prefs::kNTPPromoImageRemaining, |
| 490 profile->GetPrefs()->GetInteger(prefs::kNTPPromoImageRemaining) - 1); | 491 profile->GetPrefs()->GetInteger(prefs::kNTPPromoImageRemaining) - 1); |
| 491 first_view = false; | 492 first_view = false; |
| 492 } | 493 } |
| 493 | 494 |
| 494 if (!GetProfile()->IsOffTheRecord()) { | 495 if (!GetProfile()->IsOffTheRecord()) { |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 // URL from the new tab page, but in any case it's an error. | 676 // URL from the new tab page, but in any case it's an error. |
| 676 NOTREACHED(); | 677 NOTREACHED(); |
| 677 return; | 678 return; |
| 678 } | 679 } |
| 679 | 680 |
| 680 scoped_refptr<RefCountedBytes> html_bytes = | 681 scoped_refptr<RefCountedBytes> html_bytes = |
| 681 profile_->GetNTPResourceCache()->GetNewTabHTML(is_off_the_record); | 682 profile_->GetNTPResourceCache()->GetNewTabHTML(is_off_the_record); |
| 682 | 683 |
| 683 SendResponse(request_id, html_bytes); | 684 SendResponse(request_id, html_bytes); |
| 684 } | 685 } |
| OLD | NEW |