| OLD | NEW |
| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 // Set up the chrome://mobilesetup/ source. | 630 // Set up the chrome://mobilesetup/ source. |
| 631 Profile* profile = Profile::FromWebUI(web_ui); | 631 Profile* profile = Profile::FromWebUI(web_ui); |
| 632 content::URLDataSource::Add(profile, html_source); | 632 content::URLDataSource::Add(profile, html_source); |
| 633 | 633 |
| 634 content::WebContentsObserver::Observe(web_ui->GetWebContents()); | 634 content::WebContentsObserver::Observe(web_ui->GetWebContents()); |
| 635 } | 635 } |
| 636 | 636 |
| 637 void MobileSetupUI::DidCommitProvisionalLoadForFrame( | 637 void MobileSetupUI::DidCommitProvisionalLoadForFrame( |
| 638 content::RenderFrameHost* render_frame_host, | 638 content::RenderFrameHost* render_frame_host, |
| 639 const GURL& url, | 639 const GURL& url, |
| 640 content::PageTransition transition_type) { | 640 ui::PageTransition transition_type) { |
| 641 if (render_frame_host->GetFrameName() != "paymentForm") | 641 if (render_frame_host->GetFrameName() != "paymentForm") |
| 642 return; | 642 return; |
| 643 | 643 |
| 644 web_ui()->CallJavascriptFunction( | 644 web_ui()->CallJavascriptFunction( |
| 645 kJsPortalFrameLoadCompletedCallback); | 645 kJsPortalFrameLoadCompletedCallback); |
| 646 } | 646 } |
| 647 | 647 |
| 648 void MobileSetupUI::DidFailProvisionalLoad( | 648 void MobileSetupUI::DidFailProvisionalLoad( |
| 649 content::RenderFrameHost* render_frame_host, | 649 content::RenderFrameHost* render_frame_host, |
| 650 const GURL& validated_url, | 650 const GURL& validated_url, |
| 651 int error_code, | 651 int error_code, |
| 652 const base::string16& error_description) { | 652 const base::string16& error_description) { |
| 653 if (render_frame_host->GetFrameName() != "paymentForm") | 653 if (render_frame_host->GetFrameName() != "paymentForm") |
| 654 return; | 654 return; |
| 655 | 655 |
| 656 base::FundamentalValue result_value(-error_code); | 656 base::FundamentalValue result_value(-error_code); |
| 657 web_ui()->CallJavascriptFunction(kJsPortalFrameLoadFailedCallback, | 657 web_ui()->CallJavascriptFunction(kJsPortalFrameLoadFailedCallback, |
| 658 result_value); | 658 result_value); |
| 659 } | 659 } |
| OLD | NEW |