| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/file_manager_dialog.h" | 5 #include "chrome/browser/ui/views/file_manager_dialog.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "chrome/browser/extensions/extension_file_browser_private_api.h" | 10 #include "chrome/browser/extensions/extension_file_browser_private_api.h" |
| 11 #include "chrome/browser/extensions/extension_host.h" | 11 #include "chrome/browser/extensions/extension_host.h" |
| 12 #include "chrome/browser/extensions/file_manager_util.h" | 12 #include "chrome/browser/extensions/file_manager_util.h" |
| 13 #include "chrome/browser/sessions/restore_tab_helper.h" | 13 #include "chrome/browser/sessions/restore_tab_helper.h" |
| 14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/browser/ui/browser_list.h" | 15 #include "chrome/browser/ui/browser_list.h" |
| 16 #include "chrome/browser/ui/browser_window.h" | 16 #include "chrome/browser/ui/browser_window.h" |
| 17 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 17 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 18 #include "chrome/browser/ui/views/extensions/extension_dialog.h" | 18 #include "chrome/browser/ui/views/extensions/extension_dialog.h" |
| 19 #include "chrome/browser/ui/views/window.h" | 19 #include "chrome/browser/ui/views/window.h" |
| 20 #include "content/browser/tab_contents/tab_contents.h" | 20 #include "content/browser/tab_contents/tab_contents.h" |
| 21 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
| 22 | 22 |
| 23 using content::BrowserThread; |
| 24 |
| 23 namespace { | 25 namespace { |
| 24 | 26 |
| 25 const int kFileManagerWidth = 720; // pixels | 27 const int kFileManagerWidth = 720; // pixels |
| 26 const int kFileManagerHeight = 580; // pixels | 28 const int kFileManagerHeight = 580; // pixels |
| 27 | 29 |
| 28 // Holds references to file manager dialogs that have callbacks pending | 30 // Holds references to file manager dialogs that have callbacks pending |
| 29 // to their listeners. | 31 // to their listeners. |
| 30 class PendingDialog { | 32 class PendingDialog { |
| 31 public: | 33 public: |
| 32 static PendingDialog* GetInstance(); | 34 static PendingDialog* GetInstance(); |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 | 222 |
| 221 // Connect our listener to FileDialogFunction's per-tab callbacks. | 223 // Connect our listener to FileDialogFunction's per-tab callbacks. |
| 222 int32 tab_id = (tab ? tab->restore_tab_helper()->session_id().id() : 0); | 224 int32 tab_id = (tab ? tab->restore_tab_helper()->session_id().id() : 0); |
| 223 AddPending(tab_id); | 225 AddPending(tab_id); |
| 224 | 226 |
| 225 extension_dialog_ = dialog; | 227 extension_dialog_ = dialog; |
| 226 params_ = params; | 228 params_ = params; |
| 227 tab_id_ = tab_id; | 229 tab_id_ = tab_id; |
| 228 owner_window_ = owner_window; | 230 owner_window_ = owner_window; |
| 229 } | 231 } |
| OLD | NEW |