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

Side by Side Diff: chrome/browser/tab_contents/tab_contents_file_select_helper.h

Issue 3311016: Support accept attribute for an <input type=file> element.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_FILE_SELECT_HELPER_H_ 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_FILE_SELECT_HELPER_H_
6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_FILE_SELECT_HELPER_H_ 6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_FILE_SELECT_HELPER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 28 matching lines...) Expand all
39 // RenderViewHostDelegate::FileSelect 39 // RenderViewHostDelegate::FileSelect
40 virtual void RunFileChooser(const ViewHostMsg_RunFileChooser_Params& params); 40 virtual void RunFileChooser(const ViewHostMsg_RunFileChooser_Params& params);
41 41
42 private: 42 private:
43 // Returns the RenderViewHost of tab_contents_. 43 // Returns the RenderViewHost of tab_contents_.
44 RenderViewHost* GetRenderViewHost(); 44 RenderViewHost* GetRenderViewHost();
45 45
46 // Helper method for handling the SelectFileDialog::Listener callbacks. 46 // Helper method for handling the SelectFileDialog::Listener callbacks.
47 void DirectorySelected(const FilePath& path); 47 void DirectorySelected(const FilePath& path);
48 48
49 // Helper method to get allowed extensions for select file dialog from
50 // the specified accept types as defined in the spec:
51 // http://whatwg.org/html/number-state.html#attr-input-accept
52 SelectFileDialog::FileTypeInfo* GetFileTypesFromAcceptType(
53 const string16& accept_types);
54
49 // The tab contents this class is helping. |tab_contents_| owns this object, 55 // The tab contents this class is helping. |tab_contents_| owns this object,
50 // so this pointer is guaranteed to be valid. 56 // so this pointer is guaranteed to be valid.
51 TabContents* tab_contents_; 57 TabContents* tab_contents_;
52 58
53 // Dialog box used for choosing files to upload from file form fields. 59 // Dialog box used for choosing files to upload from file form fields.
54 scoped_refptr<SelectFileDialog> select_file_dialog_; 60 scoped_refptr<SelectFileDialog> select_file_dialog_;
55 61
56 // The type of file dialog last shown. 62 // The type of file dialog last shown.
57 SelectFileDialog::Type dialog_type_; 63 SelectFileDialog::Type dialog_type_;
58 64
59 // The current directory lister (runs on a separate thread). 65 // The current directory lister (runs on a separate thread).
60 scoped_refptr<net::DirectoryLister> directory_lister_; 66 scoped_refptr<net::DirectoryLister> directory_lister_;
61 67
62 // The current directory lister results, which may update incrementally 68 // The current directory lister results, which may update incrementally
63 // as the listing proceeds. 69 // as the listing proceeds.
64 std::vector<FilePath> directory_lister_results_; 70 std::vector<FilePath> directory_lister_results_;
65 71
66 DISALLOW_COPY_AND_ASSIGN(TabContentsFileSelectHelper); 72 DISALLOW_COPY_AND_ASSIGN(TabContentsFileSelectHelper);
67 }; 73 };
68 74
69 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_FILE_SELECT_HELPER_H_ 75 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_FILE_SELECT_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698