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

Side by Side Diff: chrome/browser/dom_ui/dom_ui_theme_source.cc

Issue 193072: Move StringPiece into the base namespace. It is colliding (Closed)
Patch Set: take 2 Created 11 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
« no previous file with comments | « chrome/browser/browser_main.cc ('k') | chrome/browser/dom_ui/downloads_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "chrome/browser/dom_ui/dom_ui_theme_source.h" 5 #include "chrome/browser/dom_ui/dom_ui_theme_source.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "app/theme_provider.h" 9 #include "app/theme_provider.h"
10 #include "base/gfx/png_encoder.h" 10 #include "base/gfx/png_encoder.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 subst2.push_back(SkColorToRGBAString(color_section_border)); // $$2 174 subst2.push_back(SkColorToRGBAString(color_section_border)); // $$2
175 subst2.push_back(SkColorToRGBAString(color_section_text)); // $$3 175 subst2.push_back(SkColorToRGBAString(color_section_text)); // $$3
176 subst2.push_back(SkColorToRGBAString(color_section_link)); // $$4 176 subst2.push_back(SkColorToRGBAString(color_section_link)); // $$4
177 subst2.push_back( 177 subst2.push_back(
178 UTF8ToUTF16(tp->HasCustomImage(IDR_THEME_NTP_ATTRIBUTION) ? 178 UTF8ToUTF16(tp->HasCustomImage(IDR_THEME_NTP_ATTRIBUTION) ?
179 "block" : "none")); // $$5 179 "block" : "none")); // $$5
180 subst2.push_back(SkColorToRGBAString(color_link_underline)); // $$6 180 subst2.push_back(SkColorToRGBAString(color_link_underline)); // $$6
181 subst2.push_back(SkColorToRGBAString(color_section_link_underline)); // $$7 181 subst2.push_back(SkColorToRGBAString(color_section_link_underline)); // $$7
182 182
183 // Get our template. 183 // Get our template.
184 static const StringPiece new_tab_theme_css( 184 static const base::StringPiece new_tab_theme_css(
185 ResourceBundle::GetSharedInstance().GetRawDataResource( 185 ResourceBundle::GetSharedInstance().GetRawDataResource(
186 IDR_NEW_TAB_THEME_CSS)); 186 IDR_NEW_TAB_THEME_CSS));
187 187
188 // Create the string from our template and the replacements. 188 // Create the string from our template and the replacements.
189 string16 format_string = ASCIIToUTF16(new_tab_theme_css.as_string()); 189 string16 format_string = ASCIIToUTF16(new_tab_theme_css.as_string());
190 const std::string css_string = UTF16ToASCII(ReplaceStringPlaceholders( 190 const std::string css_string = UTF16ToASCII(ReplaceStringPlaceholders(
191 format_string, subst, NULL)); 191 format_string, subst, NULL));
192 new_tab_css_ = UTF16ToASCII(ReplaceStringPlaceholders( 192 new_tab_css_ = UTF16ToASCII(ReplaceStringPlaceholders(
193 ASCIIToUTF16(css_string), subst2, NULL)); 193 ASCIIToUTF16(css_string), subst2, NULL));
194 } 194 }
(...skipping 13 matching lines...) Expand all
208 subst.push_back(WideToUTF16( 208 subst.push_back(WideToUTF16(
209 profile_->GetPrefs()->GetString(prefs::kCurrentThemeID))); // $1 209 profile_->GetPrefs()->GetString(prefs::kCurrentThemeID))); // $1
210 210
211 // Colors. 211 // Colors.
212 subst.push_back(SkColorToRGBAString(color_background)); // $2 212 subst.push_back(SkColorToRGBAString(color_background)); // $2
213 subst.push_back(UTF8ToUTF16(GetNewTabBackgroundCSS(false))); // $3 213 subst.push_back(UTF8ToUTF16(GetNewTabBackgroundCSS(false))); // $3
214 subst.push_back(UTF8ToUTF16(GetNewTabBackgroundCSS(true))); // $4 214 subst.push_back(UTF8ToUTF16(GetNewTabBackgroundCSS(true))); // $4
215 subst.push_back(UTF8ToUTF16(GetNewTabBackgroundTilingCSS())); // $5 215 subst.push_back(UTF8ToUTF16(GetNewTabBackgroundTilingCSS())); // $5
216 216
217 // Get our template. 217 // Get our template.
218 static const StringPiece new_tab_theme_css( 218 static const base::StringPiece new_tab_theme_css(
219 ResourceBundle::GetSharedInstance().GetRawDataResource( 219 ResourceBundle::GetSharedInstance().GetRawDataResource(
220 IDR_NEW_INCOGNITO_TAB_THEME_CSS)); 220 IDR_NEW_INCOGNITO_TAB_THEME_CSS));
221 221
222 // Create the string from our template and the replacements. 222 // Create the string from our template and the replacements.
223 string16 format_string = ASCIIToUTF16(new_tab_theme_css.as_string()); 223 string16 format_string = ASCIIToUTF16(new_tab_theme_css.as_string());
224 new_incognito_tab_css_ = UTF16ToASCII(ReplaceStringPlaceholders( 224 new_incognito_tab_css_ = UTF16ToASCII(ReplaceStringPlaceholders(
225 format_string, subst, NULL)); 225 format_string, subst, NULL));
226 } 226 }
227 227
228 void DOMUIThemeSource::SendNewTabCSS(int request_id, 228 void DOMUIThemeSource::SendNewTabCSS(int request_id,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 return BrowserThemeProvider::AlignmentToString(alignment); 284 return BrowserThemeProvider::AlignmentToString(alignment);
285 } 285 }
286 286
287 std::string DOMUIThemeSource::GetNewTabBackgroundTilingCSS() { 287 std::string DOMUIThemeSource::GetNewTabBackgroundTilingCSS() {
288 int repeat_mode; 288 int repeat_mode;
289 profile_->GetThemeProvider()->GetDisplayProperty( 289 profile_->GetThemeProvider()->GetDisplayProperty(
290 BrowserThemeProvider::NTP_BACKGROUND_TILING, &repeat_mode); 290 BrowserThemeProvider::NTP_BACKGROUND_TILING, &repeat_mode);
291 return BrowserThemeProvider::TilingToString(repeat_mode); 291 return BrowserThemeProvider::TilingToString(repeat_mode);
292 } 292 }
293 293
OLDNEW
« no previous file with comments | « chrome/browser/browser_main.cc ('k') | chrome/browser/dom_ui/downloads_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698