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

Side by Side Diff: chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc

Issue 2763013003: Specify AllowCaching = false for some ChromeOS UI pages (Closed)
Patch Set: one more build fix Created 3 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/webui/chromeos/sim_unlock_ui.h" 5 #include "chrome/browser/ui/webui/chromeos/sim_unlock_ui.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // content::URLDataSource implementation. 87 // content::URLDataSource implementation.
88 std::string GetSource() const override; 88 std::string GetSource() const override;
89 void StartDataRequest( 89 void StartDataRequest(
90 const std::string& path, 90 const std::string& path,
91 const content::ResourceRequestInfo::WebContentsGetter& wc_getter, 91 const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
92 const content::URLDataSource::GotDataCallback& callback) override; 92 const content::URLDataSource::GotDataCallback& callback) override;
93 std::string GetMimeType(const std::string&) const override { 93 std::string GetMimeType(const std::string&) const override {
94 return "text/html"; 94 return "text/html";
95 } 95 }
96 bool ShouldAddContentSecurityPolicy() const override { return false; } 96 bool ShouldAddContentSecurityPolicy() const override { return false; }
97 bool AllowCaching() const override {
98 // Should not be cached to reflect dynamically-generated contents that may
99 // depend on current settings.
100 return false;
101 }
97 102
98 private: 103 private:
99 ~SimUnlockUIHTMLSource() override {} 104 ~SimUnlockUIHTMLSource() override {}
100 105
101 std::string service_path_; 106 std::string service_path_;
102 DISALLOW_COPY_AND_ASSIGN(SimUnlockUIHTMLSource); 107 DISALLOW_COPY_AND_ASSIGN(SimUnlockUIHTMLSource);
103 }; 108 };
104 109
105 // The handler for Javascript messages related to the "sim-unlock" view. 110 // The handler for Javascript messages related to the "sim-unlock" view.
106 class SimUnlockHandler : public WebUIMessageHandler, 111 class SimUnlockHandler : public WebUIMessageHandler,
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 SimUnlockUI::SimUnlockUI(content::WebUI* web_ui) : WebUIController(web_ui) { 767 SimUnlockUI::SimUnlockUI(content::WebUI* web_ui) : WebUIController(web_ui) {
763 web_ui->AddMessageHandler(base::MakeUnique<SimUnlockHandler>()); 768 web_ui->AddMessageHandler(base::MakeUnique<SimUnlockHandler>());
764 SimUnlockUIHTMLSource* html_source = new SimUnlockUIHTMLSource(); 769 SimUnlockUIHTMLSource* html_source = new SimUnlockUIHTMLSource();
765 770
766 // Set up the chrome://sim-unlock/ source. 771 // Set up the chrome://sim-unlock/ source.
767 Profile* profile = Profile::FromWebUI(web_ui); 772 Profile* profile = Profile::FromWebUI(web_ui);
768 content::URLDataSource::Add(profile, html_source); 773 content::URLDataSource::Add(profile, html_source);
769 } 774 }
770 775
771 } // namespace chromeos 776 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc ('k') | chrome/browser/ui/webui/chromeos/slow_trace_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698