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

Side by Side Diff: ui/shell_dialogs/select_file_dialog_win.cc

Issue 72503002: Remove some pass-thrus on RootWindow API in favor of exposing the RootWindowHost again. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 1 month 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
« no previous file with comments | « ui/shell/minimal_shell.cc ('k') | ui/views/corewm/input_method_event_filter_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/shell_dialogs/select_file_dialog_win.h" 5 #include "ui/shell_dialogs/select_file_dialog_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <commdlg.h> 8 #include <commdlg.h>
9 #include <shlobj.h> 9 #include <shlobj.h>
10 10
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 aura::HandleSelectFolder( 593 aura::HandleSelectFolder(
594 UTF16ToWide(title_string), 594 UTF16ToWide(title_string),
595 base::Bind(&ui::SelectFileDialog::Listener::FileSelected, 595 base::Bind(&ui::SelectFileDialog::Listener::FileSelected,
596 base::Unretained(listener_)), 596 base::Unretained(listener_)),
597 base::Bind(&ui::SelectFileDialog::Listener::FileSelectionCanceled, 597 base::Bind(&ui::SelectFileDialog::Listener::FileSelectionCanceled,
598 base::Unretained(listener_))); 598 base::Unretained(listener_)));
599 return; 599 return;
600 } 600 }
601 } 601 }
602 HWND owner = owning_window && owning_window->GetRootWindow() 602 HWND owner = owning_window && owning_window->GetRootWindow()
603 ? owning_window->GetDispatcher()->GetAcceleratedWidget() : NULL; 603 ? owning_window->GetDispatcher()->host()->GetAcceleratedWidget() : NULL;
604 #else 604 #else
605 HWND owner = owning_window; 605 HWND owner = owning_window;
606 #endif 606 #endif
607 ExecuteSelectParams execute_params(type, UTF16ToWide(title), default_path, 607 ExecuteSelectParams execute_params(type, UTF16ToWide(title), default_path,
608 file_types, file_type_index, 608 file_types, file_type_index,
609 default_extension, BeginRun(owner), 609 default_extension, BeginRun(owner),
610 owner, params); 610 owner, params);
611 execute_params.run_state.dialog_thread->message_loop()->PostTask( 611 execute_params.run_state.dialog_thread->message_loop()->PostTask(
612 FROM_HERE, 612 FROM_HERE,
613 base::Bind(&SelectFileDialogImpl::ExecuteSelectFile, this, 613 base::Bind(&SelectFileDialogImpl::ExecuteSelectFile, this,
614 execute_params)); 614 execute_params));
615 } 615 }
616 616
617 bool SelectFileDialogImpl::HasMultipleFileTypeChoicesImpl() { 617 bool SelectFileDialogImpl::HasMultipleFileTypeChoicesImpl() {
618 return has_multiple_file_type_choices_; 618 return has_multiple_file_type_choices_;
619 } 619 }
620 620
621 bool SelectFileDialogImpl::IsRunning(gfx::NativeWindow owning_window) const { 621 bool SelectFileDialogImpl::IsRunning(gfx::NativeWindow owning_window) const {
622 #if defined(USE_AURA) 622 #if defined(USE_AURA)
623 if (!owning_window->GetRootWindow()) 623 if (!owning_window->GetRootWindow())
624 return false; 624 return false;
625 HWND owner = owning_window->GetDispatcher()->GetAcceleratedWidget(); 625 HWND owner = owning_window->GetDispatcher()->host()->GetAcceleratedWidget();
626 #else 626 #else
627 HWND owner = owning_window; 627 HWND owner = owning_window;
628 #endif 628 #endif
629 return listener_ && IsRunningDialogForOwner(owner); 629 return listener_ && IsRunningDialogForOwner(owner);
630 } 630 }
631 631
632 void SelectFileDialogImpl::ListenerDestroyed() { 632 void SelectFileDialogImpl::ListenerDestroyed() {
633 // Our associated listener has gone away, so we shouldn't call back to it if 633 // Our associated listener has gone away, so we shouldn't call back to it if
634 // our worker thread returns after the listener is dead. 634 // our worker thread returns after the listener is dead.
635 listener_ = NULL; 635 listener_ = NULL;
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 return return_value; 945 return return_value;
946 } 946 }
947 947
948 SelectFileDialog* CreateWinSelectFileDialog( 948 SelectFileDialog* CreateWinSelectFileDialog(
949 SelectFileDialog::Listener* listener, 949 SelectFileDialog::Listener* listener,
950 SelectFilePolicy* policy) { 950 SelectFilePolicy* policy) {
951 return new SelectFileDialogImpl(listener, policy); 951 return new SelectFileDialogImpl(listener, policy);
952 } 952 }
953 953
954 } // namespace ui 954 } // namespace ui
OLDNEW
« no previous file with comments | « ui/shell/minimal_shell.cc ('k') | ui/views/corewm/input_method_event_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698