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

Side by Side Diff: chrome/browser/ui/webui/chromeos/mobile_setup_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/mobile_setup_ui.h" 5 #include "chrome/browser/ui/webui/chromeos/mobile_setup_ui.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // content::URLDataSource implementation. 151 // content::URLDataSource implementation.
152 std::string GetSource() const override; 152 std::string GetSource() const override;
153 void StartDataRequest( 153 void StartDataRequest(
154 const std::string& path, 154 const std::string& path,
155 const content::ResourceRequestInfo::WebContentsGetter& wc_getter, 155 const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
156 const content::URLDataSource::GotDataCallback& callback) override; 156 const content::URLDataSource::GotDataCallback& callback) override;
157 std::string GetMimeType(const std::string&) const override { 157 std::string GetMimeType(const std::string&) const override {
158 return "text/html"; 158 return "text/html";
159 } 159 }
160 bool ShouldAddContentSecurityPolicy() const override { return false; } 160 bool ShouldAddContentSecurityPolicy() const override { return false; }
161 bool AllowCaching() const override {
162 // Should not be cached to reflect dynamically-generated contents that may
163 // depend on current settings.
164 return false;
165 }
161 166
162 private: 167 private:
163 ~MobileSetupUIHTMLSource() override {} 168 ~MobileSetupUIHTMLSource() override {}
164 169
165 void GetPropertiesAndStartDataRequest( 170 void GetPropertiesAndStartDataRequest(
166 const content::URLDataSource::GotDataCallback& callback, 171 const content::URLDataSource::GotDataCallback& callback,
167 const std::string& service_path, 172 const std::string& service_path,
168 const base::DictionaryValue& properties); 173 const base::DictionaryValue& properties);
169 void GetPropertiesFailure( 174 void GetPropertiesFailure(
170 const content::URLDataSource::GotDataCallback& callback, 175 const content::URLDataSource::GotDataCallback& callback,
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 643
639 if (navigation_handle->IsErrorPage()) { 644 if (navigation_handle->IsErrorPage()) {
640 base::Value result_value(-navigation_handle->GetNetErrorCode()); 645 base::Value result_value(-navigation_handle->GetNetErrorCode());
641 web_ui()->CallJavascriptFunctionUnsafe(kJsPortalFrameLoadFailedCallback, 646 web_ui()->CallJavascriptFunctionUnsafe(kJsPortalFrameLoadFailedCallback,
642 result_value); 647 result_value);
643 return; 648 return;
644 } 649 }
645 650
646 web_ui()->CallJavascriptFunctionUnsafe(kJsPortalFrameLoadCompletedCallback); 651 web_ui()->CallJavascriptFunctionUnsafe(kJsPortalFrameLoadCompletedCallback);
647 } 652 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698