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

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

Issue 344027: Some new tab ui fixes. (Closed)
Patch Set: Created 11 years, 1 month 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 | « no previous file | chrome/browser/dom_ui/new_tab_ui.cc » ('j') | chrome/browser/dom_ui/new_tab_ui.cc » ('J')
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/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 std::string(chrome::kChromeUIThemePath) + "/" + path); 46 std::string(chrome::kChromeUIThemePath) + "/" + path);
47 return path_url.path().substr(1); // path() always includes a leading '/'. 47 return path_url.path().substr(1); // path() always includes a leading '/'.
48 } 48 }
49 49
50 //////////////////////////////////////////////////////////////////////////////// 50 ////////////////////////////////////////////////////////////////////////////////
51 // DOMUIThemeSource, public: 51 // DOMUIThemeSource, public:
52 52
53 DOMUIThemeSource::DOMUIThemeSource(Profile* profile) 53 DOMUIThemeSource::DOMUIThemeSource(Profile* profile)
54 : DataSource(chrome::kChromeUIThemePath, MessageLoop::current()), 54 : DataSource(chrome::kChromeUIThemePath, MessageLoop::current()),
55 profile_(profile) { 55 profile_(profile) {
56 InitNewTabCSS(); 56 if (profile->IsOffTheRecord())
57 InitNewIncognitoTabCSS(); 57 InitNewIncognitoTabCSS();
58 else
59 InitNewTabCSS();
58 } 60 }
59 61
60 void DOMUIThemeSource::StartDataRequest(const std::string& path, 62 void DOMUIThemeSource::StartDataRequest(const std::string& path,
61 int request_id) { 63 int request_id) {
62 // Our path may include cachebuster arguments, so trim them off. 64 // Our path may include cachebuster arguments, so trim them off.
63 std::string uncached_path = StripQueryParams(path); 65 std::string uncached_path = StripQueryParams(path);
64 66
65 if (uncached_path == kNewTabCSSPath) { 67 if (uncached_path == kNewTabCSSPath) {
66 SendNewTabCSS(request_id, new_tab_css_); 68 SendNewTabCSS(request_id, new_tab_css_);
67 return; 69 return;
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 return BrowserThemeProvider::AlignmentToString(alignment); 289 return BrowserThemeProvider::AlignmentToString(alignment);
288 } 290 }
289 291
290 std::string DOMUIThemeSource::GetNewTabBackgroundTilingCSS() { 292 std::string DOMUIThemeSource::GetNewTabBackgroundTilingCSS() {
291 int repeat_mode; 293 int repeat_mode;
292 profile_->GetThemeProvider()->GetDisplayProperty( 294 profile_->GetThemeProvider()->GetDisplayProperty(
293 BrowserThemeProvider::NTP_BACKGROUND_TILING, &repeat_mode); 295 BrowserThemeProvider::NTP_BACKGROUND_TILING, &repeat_mode);
294 return BrowserThemeProvider::TilingToString(repeat_mode); 296 return BrowserThemeProvider::TilingToString(repeat_mode);
295 } 297 }
296 298
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/dom_ui/new_tab_ui.cc » ('j') | chrome/browser/dom_ui/new_tab_ui.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698