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

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

Issue 14307023: chrome: Use base::MessageLoop. (Part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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) 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 #include "chrome/browser/ui/views/select_file_dialog_extension.h" 5 #include "chrome/browser/ui/views/select_file_dialog_extension.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 // Reload the extension after a bit; the extension may not have been unloaded 143 // Reload the extension after a bit; the extension may not have been unloaded
144 // yet. We don't want to try to reload the extension only to have the Unload 144 // yet. We don't want to try to reload the extension only to have the Unload
145 // code execute after us and re-unload the extension. 145 // code execute after us and re-unload the extension.
146 // 146 //
147 // TODO(rkc): This is ugly. The ideal solution is that we shouldn't need to 147 // TODO(rkc): This is ugly. The ideal solution is that we shouldn't need to
148 // reload the extension at all - when we try to open the extension the next 148 // reload the extension at all - when we try to open the extension the next
149 // time, the extension subsystem would automatically reload it for us. At 149 // time, the extension subsystem would automatically reload it for us. At
150 // this time though this is broken because of some faulty wiring in 150 // this time though this is broken because of some faulty wiring in
151 // ExtensionProcessManager::CreateViewHost. Once that is fixed, remove this. 151 // ExtensionProcessManager::CreateViewHost. Once that is fixed, remove this.
152 if (profile_) { 152 if (profile_) {
153 MessageLoop::current()->PostTask(FROM_HERE, 153 base::MessageLoop::current()->PostTask(
154 FROM_HERE,
154 base::Bind(&ExtensionService::ReloadExtension, 155 base::Bind(&ExtensionService::ReloadExtension,
155 base::Unretained(extensions::ExtensionSystem::Get(profile_)-> 156 base::Unretained(extensions::ExtensionSystem::Get(profile_)
156 extension_service()), 157 ->extension_service()),
157 extension_id)); 158 extension_id));
158 } 159 }
159 160
160 dialog->Close(); 161 dialog->Close();
161 } 162 }
162 163
163 // static 164 // static
164 void SelectFileDialogExtension::OnFileSelected( 165 void SelectFileDialogExtension::OnFileSelected(
165 int32 tab_id, 166 int32 tab_id,
166 const ui::SelectedFileInfo& file, 167 const ui::SelectedFileInfo& file,
167 int index) { 168 int index) {
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 kFileManagerMinimumHeight); 369 kFileManagerMinimumHeight);
369 370
370 // Connect our listener to FileDialogFunction's per-tab callbacks. 371 // Connect our listener to FileDialogFunction's per-tab callbacks.
371 AddPending(tab_id); 372 AddPending(tab_id);
372 373
373 extension_dialog_ = dialog; 374 extension_dialog_ = dialog;
374 params_ = params; 375 params_ = params;
375 tab_id_ = tab_id; 376 tab_id_ = tab_id;
376 owner_window_ = owner_window; 377 owner_window_ = owner_window;
377 } 378 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/reload_button_unittest.cc ('k') | chrome/browser/ui/views/simple_message_box_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698