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

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: 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 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 web_ui->AddMessageHandler(base::MakeUnique<MobileSetupHandler>()); 621 web_ui->AddMessageHandler(base::MakeUnique<MobileSetupHandler>());
622 MobileSetupUIHTMLSource* html_source = new MobileSetupUIHTMLSource(); 622 MobileSetupUIHTMLSource* html_source = new MobileSetupUIHTMLSource();
623 623
624 // Set up the chrome://mobilesetup/ source. 624 // Set up the chrome://mobilesetup/ source.
625 Profile* profile = Profile::FromWebUI(web_ui); 625 Profile* profile = Profile::FromWebUI(web_ui);
626 content::URLDataSource::Add(profile, html_source); 626 content::URLDataSource::Add(profile, html_source);
627 627
628 content::WebContentsObserver::Observe(web_ui->GetWebContents()); 628 content::WebContentsObserver::Observe(web_ui->GetWebContents());
629 } 629 }
630 630
631 bool MobileSetupUI::AllowCaching() const {
632 // Should not be cached to reflect dynamically-generated contents.
633 return false;
634 }
635
631 void MobileSetupUI::DidFinishNavigation( 636 void MobileSetupUI::DidFinishNavigation(
632 content::NavigationHandle* navigation_handle) { 637 content::NavigationHandle* navigation_handle) {
633 if (!navigation_handle->HasCommitted() || 638 if (!navigation_handle->HasCommitted() ||
634 navigation_handle->GetRenderFrameHost()->GetFrameName() != 639 navigation_handle->GetRenderFrameHost()->GetFrameName() !=
635 "paymentForm") { 640 "paymentForm") {
636 return; 641 return;
637 } 642 }
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