OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extensions/extension_loader_handler.h" | 5 #include "chrome/browser/ui/webui/extensions/extension_loader_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
92 // it doesn't try and call back. | 92 // it doesn't try and call back. |
93 if (load_extension_dialog_.get()) | 93 if (load_extension_dialog_.get()) |
94 load_extension_dialog_->ListenerDestroyed(); | 94 load_extension_dialog_->ListenerDestroyed(); |
95 } | 95 } |
96 | 96 |
97 void ExtensionLoaderHandler::FileHelper::ChooseFile() { | 97 void ExtensionLoaderHandler::FileHelper::ChooseFile() { |
98 static const int kFileTypeIndex = 0; // No file type information to index. | 98 static const int kFileTypeIndex = 0; // No file type information to index. |
99 static const ui::SelectFileDialog::Type kSelectType = | 99 static const ui::SelectFileDialog::Type kSelectType = |
100 ui::SelectFileDialog::SELECT_FOLDER; | 100 ui::SelectFileDialog::SELECT_FOLDER; |
101 | 101 |
102 if (!load_extension_dialog_.get()) { | 102 load_extension_dialog_ = ui::SelectFileDialog::Create( |
Devlin
2014/12/03 17:47:55
hmm... I have a slight concern in that ui::SelectF
Devlin
2014/12/03 17:59:00
For instance, this causes a problem on line 94, wh
| |
103 load_extension_dialog_ = ui::SelectFileDialog::Create( | 103 this, |
104 this, | 104 new ChromeSelectFilePolicy( |
105 new ChromeSelectFilePolicy( | 105 loader_handler_->web_ui()->GetWebContents())); |
106 loader_handler_->web_ui()->GetWebContents())); | |
107 } | |
108 | 106 |
109 load_extension_dialog_->SelectFile( | 107 load_extension_dialog_->SelectFile( |
110 kSelectType, | 108 kSelectType, |
111 title_, | 109 title_, |
112 last_unpacked_directory_, | 110 last_unpacked_directory_, |
113 NULL, | 111 NULL, |
114 kFileTypeIndex, | 112 kFileTypeIndex, |
115 base::FilePath::StringType(), | 113 base::FilePath::StringType(), |
116 loader_handler_->web_ui()->GetWebContents()->GetTopLevelNativeWindow(), | 114 loader_handler_->web_ui()->GetWebContents()->GetTopLevelNativeWindow(), |
117 NULL); | 115 NULL); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
301 } | 299 } |
302 | 300 |
303 void ExtensionLoaderHandler::NotifyFrontendOfFailure() { | 301 void ExtensionLoaderHandler::NotifyFrontendOfFailure() { |
304 web_ui()->CallJavascriptFunction( | 302 web_ui()->CallJavascriptFunction( |
305 "extensions.ExtensionLoader.notifyLoadFailed", | 303 "extensions.ExtensionLoader.notifyLoadFailed", |
306 failures_); | 304 failures_); |
307 failures_.Clear(); | 305 failures_.Clear(); |
308 } | 306 } |
309 | 307 |
310 } // namespace extensions | 308 } // namespace extensions |
OLD | NEW |