| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/dom_ui/new_tab_ui.h" | 5 #include "chrome/browser/dom_ui/new_tab_ui.h" |
| 6 | 6 |
| 7 #include "base/histogram.h" | 7 #include "base/histogram.h" |
| 8 #include "base/string_piece.h" | 8 #include "base/string_piece.h" |
| 9 #include "chrome/app/locales/locale_settings.h" | 9 #include "chrome/app/locales/locale_settings.h" |
| 10 #include "chrome/browser/browser.h" | 10 #include "chrome/browser/browser.h" |
| (...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 url += ":"; | 736 url += ":"; |
| 737 return GURL(url); | 737 return GURL(url); |
| 738 } | 738 } |
| 739 | 739 |
| 740 NewTabUIContents::NewTabUIContents(Profile* profile, | 740 NewTabUIContents::NewTabUIContents(Profile* profile, |
| 741 SiteInstance* instance, RenderViewHostFactory* render_view_factory) : | 741 SiteInstance* instance, RenderViewHostFactory* render_view_factory) : |
| 742 DOMUIHost(profile, instance, render_view_factory), | 742 DOMUIHost(profile, instance, render_view_factory), |
| 743 motd_message_id_(0), | 743 motd_message_id_(0), |
| 744 incognito_(false), | 744 incognito_(false), |
| 745 most_visited_handler_(NULL) { | 745 most_visited_handler_(NULL) { |
| 746 type_ = TAB_CONTENTS_NEW_TAB_UI; | 746 set_type(TAB_CONTENTS_NEW_TAB_UI); |
| 747 set_forced_title(l10n_util::GetString(IDS_NEW_TAB_TITLE)); | 747 set_forced_title(l10n_util::GetString(IDS_NEW_TAB_TITLE)); |
| 748 | 748 |
| 749 if (profile->IsOffTheRecord()) | 749 if (profile->IsOffTheRecord()) |
| 750 incognito_ = true; | 750 incognito_ = true; |
| 751 | 751 |
| 752 if (NewTabHTMLSource::first_view() && | 752 if (NewTabHTMLSource::first_view() && |
| 753 (profile->GetPrefs()->GetInteger(prefs::kRestoreOnStartup) != 0 || | 753 (profile->GetPrefs()->GetInteger(prefs::kRestoreOnStartup) != 0 || |
| 754 !profile->GetPrefs()->GetBoolean(prefs::kHomePageIsNewTabPage)) | 754 !profile->GetPrefs()->GetBoolean(prefs::kHomePageIsNewTabPage)) |
| 755 ) { | 755 ) { |
| 756 NewTabHTMLSource::set_first_view(false); | 756 NewTabHTMLSource::set_first_view(false); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 for (size_t i = 0; i < urls.size(); ++i) { | 843 for (size_t i = 0; i < urls.size(); ++i) { |
| 844 if (url == urls[i]) { | 844 if (url == urls[i]) { |
| 845 UserMetrics::RecordComputedAction(StringPrintf(L"MostVisited%d", i), | 845 UserMetrics::RecordComputedAction(StringPrintf(L"MostVisited%d", i), |
| 846 profile()); | 846 profile()); |
| 847 break; | 847 break; |
| 848 } | 848 } |
| 849 } | 849 } |
| 850 } | 850 } |
| 851 } | 851 } |
| 852 | 852 |
| OLD | NEW |