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

Side by Side Diff: chrome/browser/ui/views/select_file_dialog_extension.h

Issue 857433003: Update {virtual,override,final} to follow C++11 style chrome/browser/ui. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix rebase Created 5 years, 11 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 #ifndef CHROME_BROWSER_UI_VIEWS_SELECT_FILE_DIALOG_EXTENSION_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_SELECT_FILE_DIALOG_EXTENSION_H_
6 #define CHROME_BROWSER_UI_VIEWS_SELECT_FILE_DIALOG_EXTENSION_H_ 6 #define CHROME_BROWSER_UI_VIEWS_SELECT_FILE_DIALOG_EXTENSION_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 25 matching lines...) Expand all
36 // every WebContents. 36 // every WebContents.
37 typedef const void* RoutingID; 37 typedef const void* RoutingID;
38 static RoutingID GetRoutingIDFromWebContents( 38 static RoutingID GetRoutingIDFromWebContents(
39 const content::WebContents* web_contents); 39 const content::WebContents* web_contents);
40 40
41 static SelectFileDialogExtension* Create( 41 static SelectFileDialogExtension* Create(
42 ui::SelectFileDialog::Listener* listener, 42 ui::SelectFileDialog::Listener* listener,
43 ui::SelectFilePolicy* policy); 43 ui::SelectFilePolicy* policy);
44 44
45 // BaseShellDialog implementation. 45 // BaseShellDialog implementation.
46 virtual bool IsRunning(gfx::NativeWindow owner_window) const override; 46 bool IsRunning(gfx::NativeWindow owner_window) const override;
47 virtual void ListenerDestroyed() override; 47 void ListenerDestroyed() override;
48 48
49 // ExtensionDialog::Observer implementation. 49 // ExtensionDialog::Observer implementation.
50 virtual void ExtensionDialogClosing(ExtensionDialog* dialog) override; 50 void ExtensionDialogClosing(ExtensionDialog* dialog) override;
51 virtual void ExtensionTerminated(ExtensionDialog* dialog) override; 51 void ExtensionTerminated(ExtensionDialog* dialog) override;
52 52
53 // Routes callback to appropriate SelectFileDialog::Listener based on the 53 // Routes callback to appropriate SelectFileDialog::Listener based on the
54 // owning |web_contents|. 54 // owning |web_contents|.
55 static void OnFileSelected(RoutingID routing_id, 55 static void OnFileSelected(RoutingID routing_id,
56 const ui::SelectedFileInfo& file, 56 const ui::SelectedFileInfo& file,
57 int index); 57 int index);
58 static void OnMultiFilesSelected( 58 static void OnMultiFilesSelected(
59 RoutingID routing_id, 59 RoutingID routing_id,
60 const std::vector<ui::SelectedFileInfo>& files); 60 const std::vector<ui::SelectedFileInfo>& files);
61 static void OnFileSelectionCanceled(RoutingID routing_id); 61 static void OnFileSelectionCanceled(RoutingID routing_id);
62 62
63 // For testing, so we can inject JavaScript into the contained view. 63 // For testing, so we can inject JavaScript into the contained view.
64 content::RenderViewHost* GetRenderViewHost(); 64 content::RenderViewHost* GetRenderViewHost();
65 65
66 protected: 66 protected:
67 // SelectFileDialog implementation. 67 // SelectFileDialog implementation.
68 virtual void SelectFileImpl( 68 void SelectFileImpl(Type type,
69 Type type, 69 const base::string16& title,
70 const base::string16& title, 70 const base::FilePath& default_path,
71 const base::FilePath& default_path, 71 const FileTypeInfo* file_types,
72 const FileTypeInfo* file_types, 72 int file_type_index,
73 int file_type_index, 73 const base::FilePath::StringType& default_extension,
74 const base::FilePath::StringType& default_extension, 74 gfx::NativeWindow owning_window,
75 gfx::NativeWindow owning_window, 75 void* params) override;
76 void* params) override;
77 76
78 private: 77 private:
79 friend class SelectFileDialogExtensionBrowserTest; 78 friend class SelectFileDialogExtensionBrowserTest;
80 friend class SelectFileDialogExtensionTest; 79 friend class SelectFileDialogExtensionTest;
81 80
82 // Object is ref-counted, use Create(). 81 // Object is ref-counted, use Create().
83 explicit SelectFileDialogExtension(SelectFileDialog::Listener* listener, 82 explicit SelectFileDialogExtension(SelectFileDialog::Listener* listener,
84 ui::SelectFilePolicy* policy); 83 ui::SelectFilePolicy* policy);
85 virtual ~SelectFileDialogExtension(); 84 ~SelectFileDialogExtension() override;
86 85
87 // Invokes the appropriate file selection callback on our listener. 86 // Invokes the appropriate file selection callback on our listener.
88 void NotifyListener(); 87 void NotifyListener();
89 88
90 // Adds this to the list of pending dialogs, used for testing. 89 // Adds this to the list of pending dialogs, used for testing.
91 void AddPending(RoutingID routing_id); 90 void AddPending(RoutingID routing_id);
92 91
93 // Check if the list of pending dialogs contains dialog for |routing_id|. 92 // Check if the list of pending dialogs contains dialog for |routing_id|.
94 static bool PendingExists(RoutingID routing_id); 93 static bool PendingExists(RoutingID routing_id);
95 94
96 // Returns true if the dialog has multiple file type choices. 95 // Returns true if the dialog has multiple file type choices.
97 virtual bool HasMultipleFileTypeChoicesImpl() override; 96 bool HasMultipleFileTypeChoicesImpl() override;
98 97
99 bool has_multiple_file_type_choices_; 98 bool has_multiple_file_type_choices_;
100 99
101 // Host for the extension that implements this dialog. 100 // Host for the extension that implements this dialog.
102 scoped_refptr<ExtensionDialog> extension_dialog_; 101 scoped_refptr<ExtensionDialog> extension_dialog_;
103 102
104 // ID of the tab that spawned this dialog, used to route callbacks. 103 // ID of the tab that spawned this dialog, used to route callbacks.
105 RoutingID routing_id_; 104 RoutingID routing_id_;
106 105
107 // Pointer to the profile the dialog is running in. 106 // Pointer to the profile the dialog is running in.
(...skipping 12 matching lines...) Expand all
120 }; 119 };
121 SelectionType selection_type_; 120 SelectionType selection_type_;
122 std::vector<ui::SelectedFileInfo> selection_files_; 121 std::vector<ui::SelectedFileInfo> selection_files_;
123 int selection_index_; 122 int selection_index_;
124 void* params_; 123 void* params_;
125 124
126 DISALLOW_COPY_AND_ASSIGN(SelectFileDialogExtension); 125 DISALLOW_COPY_AND_ASSIGN(SelectFileDialogExtension);
127 }; 126 };
128 127
129 #endif // CHROME_BROWSER_UI_VIEWS_SELECT_FILE_DIALOG_EXTENSION_H_ 128 #endif // CHROME_BROWSER_UI_VIEWS_SELECT_FILE_DIALOG_EXTENSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698