OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1815 EXPECT_TRUE(NavigateToURL(shell(), regular_page_url)); | 1815 EXPECT_TRUE(NavigateToURL(shell(), regular_page_url)); |
1816 EXPECT_FALSE(ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( | 1816 EXPECT_FALSE(ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( |
1817 shell()->web_contents()->GetRenderProcessHost()->GetID())); | 1817 shell()->web_contents()->GetRenderProcessHost()->GetID())); |
1818 } | 1818 } |
1819 | 1819 |
1820 class FileChooserDelegate : public WebContentsDelegate { | 1820 class FileChooserDelegate : public WebContentsDelegate { |
1821 public: | 1821 public: |
1822 FileChooserDelegate(const base::FilePath& file) | 1822 FileChooserDelegate(const base::FilePath& file) |
1823 : file_(file), file_chosen_(false) {} | 1823 : file_(file), file_chosen_(false) {} |
1824 | 1824 |
1825 void RunFileChooser(WebContents* web_contents, | 1825 void RunFileChooser(RenderFrameHost* render_frame_host, |
1826 const FileChooserParams& params) override { | 1826 const FileChooserParams& params) override { |
1827 // Send the selected file to the renderer process. | 1827 // Send the selected file to the renderer process. |
1828 FileChooserFileInfo file_info; | 1828 FileChooserFileInfo file_info; |
1829 file_info.file_path = file_; | 1829 file_info.file_path = file_; |
1830 std::vector<FileChooserFileInfo> files; | 1830 std::vector<FileChooserFileInfo> files; |
1831 files.push_back(file_info); | 1831 files.push_back(file_info); |
1832 web_contents->GetRenderViewHost()->FilesSelectedInChooser( | 1832 render_frame_host->FilesSelectedInChooser(files, FileChooserParams::Open); |
1833 files, FileChooserParams::Open); | |
1834 | 1833 |
1835 file_chosen_ = true; | 1834 file_chosen_ = true; |
1836 } | 1835 } |
1837 | 1836 |
1838 bool file_chosen() { return file_chosen_; } | 1837 bool file_chosen() { return file_chosen_; } |
1839 | 1838 |
1840 private: | 1839 private: |
1841 base::FilePath file_; | 1840 base::FilePath file_; |
1842 bool file_chosen_; | 1841 bool file_chosen_; |
1843 }; | 1842 }; |
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2750 TestNavigationObserver commit_observer(web_contents); | 2749 TestNavigationObserver commit_observer(web_contents); |
2751 shell()->LoadURL(embedded_test_server()->GetURL("b.com", "/title1.html")); | 2750 shell()->LoadURL(embedded_test_server()->GetURL("b.com", "/title1.html")); |
2752 commit_observer.Wait(); | 2751 commit_observer.Wait(); |
2753 exit_observer.Wait(); | 2752 exit_observer.Wait(); |
2754 | 2753 |
2755 // Ensure the entry's title hasn't changed after the ignored commit. | 2754 // Ensure the entry's title hasn't changed after the ignored commit. |
2756 EXPECT_EQ(title, entry->GetTitle()); | 2755 EXPECT_EQ(title, entry->GetTitle()); |
2757 } | 2756 } |
2758 | 2757 |
2759 } // namespace content | 2758 } // namespace content |
OLD | NEW |