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

Side by Side Diff: chrome/browser/ui/webui/extensions/extension_loader_handler.cc

Issue 772983002: Fix a crash on clicking "Load unpacked extension" multiple times (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698