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

Side by Side Diff: chrome/browser/ui/webui/ntp/ntp_resource_cache_android.cc

Issue 10808052: Tidy up Android's is-tablet functionality. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 5 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 | Annotate | Revision Log
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 "chrome/browser/ui/webui/ntp/ntp_resource_cache.h" 5 #include "chrome/browser/ui/webui/ntp/ntp_resource_cache.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/ref_counted_memory.h" 8 #include "base/memory/ref_counted_memory.h"
9 #include "base/string16.h" 9 #include "base/string16.h"
10 #include "base/string_piece.h" 10 #include "base/string_piece.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 NewTabPageHandler::GetLocalizedValues(profile_, &localized_strings); 74 NewTabPageHandler::GetLocalizedValues(profile_, &localized_strings);
75 75
76 ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings); 76 ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings);
77 77
78 base::StringPiece new_tab_html(ResourceBundle::GetSharedInstance(). 78 base::StringPiece new_tab_html(ResourceBundle::GetSharedInstance().
79 GetRawDataResource(IDR_NEW_TAB_4_HTML, 79 GetRawDataResource(IDR_NEW_TAB_4_HTML,
80 ui::SCALE_FACTOR_NONE)); 80 ui::SCALE_FACTOR_NONE));
81 localized_strings.SetString( 81 localized_strings.SetString(
82 "device", 82 "device",
83 CommandLine::ForCurrentProcess()->HasSwitch(switches::kTabletUi) ? 83 CommandLine::ForCurrentProcess()->HasSwitch(switches::kTabletUI) ?
84 "tablet" : "phone"); 84 "tablet" : "phone");
85 const char* new_tab_link = kLearnMoreIncognitoUrl; 85 const char* new_tab_link = kLearnMoreIncognitoUrl;
86 string16 learnMoreLink = ASCIIToUTF16( 86 string16 learnMoreLink = ASCIIToUTF16(
87 google_util::AppendGoogleLocaleParam(GURL(new_tab_link)).spec()); 87 google_util::AppendGoogleLocaleParam(GURL(new_tab_link)).spec());
88 localized_strings.SetString("content", 88 localized_strings.SetString("content",
89 l10n_util::GetStringFUTF16(IDS_NEW_TAB_OTR_MESSAGE, learnMoreLink)); 89 l10n_util::GetStringFUTF16(IDS_NEW_TAB_OTR_MESSAGE, learnMoreLink));
90 90
91 // Load the new tab page appropriate for this build. 91 // Load the new tab page appropriate for this build.
92 std::string full_html; 92 std::string full_html;
93 93
(...skipping 12 matching lines...) Expand all
106 size_t after_offset = pos + template_data_placeholder.size(); 106 size_t after_offset = pos + template_data_placeholder.size();
107 full_html.append(new_tab_html.data() + after_offset, 107 full_html.append(new_tab_html.data() + after_offset,
108 new_tab_html.size() - after_offset); 108 new_tab_html.size() - after_offset);
109 } else { 109 } else {
110 NOTREACHED(); 110 NOTREACHED();
111 full_html.assign(new_tab_html.data(), new_tab_html.size()); 111 full_html.assign(new_tab_html.data(), new_tab_html.size());
112 } 112 }
113 113
114 new_tab_html_ = base::RefCountedString::TakeString(&full_html); 114 new_tab_html_ = base::RefCountedString::TakeString(&full_html);
115 } 115 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698