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

Side by Side Diff: chrome/browser/dom_ui/web_ui_theme_source.h

Issue 6546078: Makes a handful of DataSources not replace the existing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_DOM_UI_WEB_UI_THEME_SOURCE_H_ 5 #ifndef CHROME_BROWSER_DOM_UI_WEB_UI_THEME_SOURCE_H_
6 #define CHROME_BROWSER_DOM_UI_WEB_UI_THEME_SOURCE_H_ 6 #define CHROME_BROWSER_DOM_UI_WEB_UI_THEME_SOURCE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "chrome/browser/webui/chrome_url_data_manager.h" 11 #include "chrome/browser/webui/chrome_url_data_manager.h"
12 12
13 class Profile; 13 class Profile;
14 class RefCountedBytes; 14 class RefCountedBytes;
15 15
16 class WebUIThemeSource : public ChromeURLDataManager::DataSource { 16 class WebUIThemeSource : public ChromeURLDataManager::DataSource {
17 public: 17 public:
18 explicit WebUIThemeSource(Profile* profile); 18 explicit WebUIThemeSource(Profile* profile);
19 19
20 // Called when the network layer has requested a resource underneath 20 // Called when the network layer has requested a resource underneath
21 // the path we registered. 21 // the path we registered.
22 virtual void StartDataRequest(const std::string& path, 22 virtual void StartDataRequest(const std::string& path,
23 bool is_off_the_record, 23 bool is_off_the_record,
24 int request_id); 24 int request_id);
25 virtual std::string GetMimeType(const std::string& path) const; 25 virtual std::string GetMimeType(const std::string& path) const;
26 26
27 // Used to tell ChromeURLDataManager which thread to handle the request on. 27 // Used to tell ChromeURLDataManager which thread to handle the request on.
28 virtual MessageLoop* MessageLoopForRequestPath(const std::string& path) const; 28 virtual MessageLoop* MessageLoopForRequestPath(const std::string& path) const;
29 29
30 virtual bool ShouldReplaceExistingSource() const;
31
30 protected: 32 protected:
31 virtual ~WebUIThemeSource(); 33 virtual ~WebUIThemeSource();
32 34
33 private: 35 private:
34 // Fetch and send the theme bitmap. 36 // Fetch and send the theme bitmap.
35 void SendThemeBitmap(int request_id, int resource_id); 37 void SendThemeBitmap(int request_id, int resource_id);
36 38
37 // The original profile (never an OTR profile). 39 // The original profile (never an OTR profile).
38 Profile* profile_; 40 Profile* profile_;
39 41
40 // We grab the CSS early so we don't have to go back to the UI thread later. 42 // We grab the CSS early so we don't have to go back to the UI thread later.
41 scoped_refptr<RefCountedBytes> css_bytes_; 43 scoped_refptr<RefCountedBytes> css_bytes_;
42 44
43 DISALLOW_COPY_AND_ASSIGN(WebUIThemeSource); 45 DISALLOW_COPY_AND_ASSIGN(WebUIThemeSource);
44 }; 46 };
45 47
46 #endif // CHROME_BROWSER_DOM_UI_WEB_UI_THEME_SOURCE_H_ 48 #endif // CHROME_BROWSER_DOM_UI_WEB_UI_THEME_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698