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

Side by Side Diff: chrome/browser/ui/webui/quota_internals_ui.cc

Issue 7259007: Revert 90447 - Add chrome://quota-internals/ resources (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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/ui/webui/quota_internals_ui.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/webui/quota_internals_ui.h"
6
7 #include <algorithm>
8 #include <string>
9
10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/common/url_constants.h"
12 #include "content/browser/tab_contents/tab_contents.h"
13 #include "content/common/json_value_serializer.h"
14 #include "grit/quota_internals_resources.h"
15 #include "ui/base/l10n/l10n_util.h"
16 #include "ui/base/resource/resource_bundle.h"
17
18 QuotaInternalsUI::QuotaInternalsUI(TabContents* contents)
19 : ChromeWebUI(contents) {
20 // TODO(tzik): implement and attach message handler
21 contents->profile()->GetChromeURLDataManager()->
22 AddDataSource(new quota_internals::QuotaInternalsHTMLSource);
23 }
24
25 namespace quota_internals {
26
27 const char QuotaInternalsHTMLSource::kStringsJSPath[] = "strings.js";
28
29 QuotaInternalsHTMLSource::QuotaInternalsHTMLSource()
30 : ChromeWebUIDataSource(chrome::kChromeUIQuotaInternalsHost) {
31 }
32
33 void QuotaInternalsHTMLSource::StartDataRequest(const std::string& path,
34 bool is_incognito,
35 int request_id) OVERRIDE {
36 if (path == kStringsJSPath)
37 SendLocalizedStringsAsJSON(request_id);
38 else
39 SendFromResourceBundle(request_id, IDR_QUOTA_INTERNALS_MAIN_HTML);
40 }
41
42 std::string QuotaInternalsHTMLSource::GetMimeType(
43 const std::string& path) const {
44 if (path == kStringsJSPath)
45 return "application/javascript";
46 else
47 return "text/html";
48 }
49
50 } // namespace quota_internals
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/quota_internals_ui.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698