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

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

Issue 6257006: Move a bunch of random other files to src/ui/base... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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
« no previous file with comments | « chrome/browser/dom_ui/bug_report_ui.cc ('k') | chrome/browser/dom_ui/ntp_resource_cache.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/resource_bundle.h" 7 #include "app/resource_bundle.h"
8 #include "app/theme_provider.h"
9 #include "base/message_loop.h" 8 #include "base/message_loop.h"
10 #include "base/ref_counted_memory.h" 9 #include "base/ref_counted_memory.h"
11 #include "chrome/browser/browser_thread.h" 10 #include "chrome/browser/browser_thread.h"
12 #include "chrome/browser/dom_ui/ntp_resource_cache.h" 11 #include "chrome/browser/dom_ui/ntp_resource_cache.h"
13 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/resources_util.h" 13 #include "chrome/browser/resources_util.h"
15 #include "chrome/browser/themes/browser_theme_provider.h" 14 #include "chrome/browser/themes/browser_theme_provider.h"
16 #include "chrome/common/url_constants.h" 15 #include "chrome/common/url_constants.h"
17 #include "googleurl/src/gurl.h" 16 #include "googleurl/src/gurl.h"
17 #include "ui/base/theme_provider.h"
18 18
19 // use a resource map rather than hard-coded strings. 19 // use a resource map rather than hard-coded strings.
20 static const char* kNewTabCSSPath = "css/newtab.css"; 20 static const char* kNewTabCSSPath = "css/newtab.css";
21 static const char* kNewIncognitoTabCSSPath = "css/newincognitotab.css"; 21 static const char* kNewIncognitoTabCSSPath = "css/newincognitotab.css";
22 22
23 static std::string StripQueryParams(const std::string& path) { 23 static std::string StripQueryParams(const std::string& path) {
24 GURL path_url = GURL(std::string(chrome::kChromeUIScheme) + "://" + 24 GURL path_url = GURL(std::string(chrome::kChromeUIScheme) + "://" +
25 std::string(chrome::kChromeUIThemePath) + "/" + path); 25 std::string(chrome::kChromeUIThemePath) + "/" + path);
26 return path_url.path().substr(1); // path() always includes a leading '/'. 26 return path_url.path().substr(1); // path() always includes a leading '/'.
27 } 27 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 return DataSource::MessageLoopForRequestPath(path); 94 return DataSource::MessageLoopForRequestPath(path);
95 } 95 }
96 96
97 //////////////////////////////////////////////////////////////////////////////// 97 ////////////////////////////////////////////////////////////////////////////////
98 // DOMUIThemeSource, private: 98 // DOMUIThemeSource, private:
99 99
100 void DOMUIThemeSource::SendThemeBitmap(int request_id, int resource_id) { 100 void DOMUIThemeSource::SendThemeBitmap(int request_id, int resource_id) {
101 if (BrowserThemeProvider::IsThemeableImage(resource_id)) { 101 if (BrowserThemeProvider::IsThemeableImage(resource_id)) {
102 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 102 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
103 ThemeProvider* tp = profile_->GetThemeProvider(); 103 ui::ThemeProvider* tp = profile_->GetThemeProvider();
104 DCHECK(tp); 104 DCHECK(tp);
105 105
106 scoped_refptr<RefCountedMemory> image_data(tp->GetRawData(resource_id)); 106 scoped_refptr<RefCountedMemory> image_data(tp->GetRawData(resource_id));
107 SendResponse(request_id, image_data); 107 SendResponse(request_id, image_data);
108 } else { 108 } else {
109 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 109 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
110 const ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 110 const ResourceBundle& rb = ResourceBundle::GetSharedInstance();
111 SendResponse(request_id, rb.LoadDataResourceBytes(resource_id)); 111 SendResponse(request_id, rb.LoadDataResourceBytes(resource_id));
112 } 112 }
113 } 113 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/bug_report_ui.cc ('k') | chrome/browser/dom_ui/ntp_resource_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698