| 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 #import "chrome/browser/ui/cocoa/extensions/device_permissions_dialog_controller
.h" | 5 #import "chrome/browser/ui/cocoa/extensions/device_permissions_dialog_controller
.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| 11 #include "chrome/browser/extensions/api/chrome_device_permissions_prompt.h" | 11 #include "chrome/browser/extensions/api/chrome_device_permissions_prompt.h" |
| 12 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sh
eet.h" | 12 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sh
eet.h" |
| 13 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_wi
ndow.h" | 13 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_wi
ndow.h" |
| 14 #import "chrome/browser/ui/cocoa/extensions/device_permissions_view_controller.h
" | 14 #import "chrome/browser/ui/cocoa/extensions/device_permissions_view_controller.h
" |
| 15 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 15 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 16 #include "device/usb/usb_device.h" | 16 #include "device/usb/usb_device.h" |
| 17 | 17 |
| 18 using extensions::DevicePermissionsPrompt; | 18 using extensions::DevicePermissionsPrompt; |
| 19 | 19 |
| 20 DevicePermissionsDialogController::DevicePermissionsDialogController( | 20 DevicePermissionsDialogController::DevicePermissionsDialogController( |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents()); | 60 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents()); |
| 61 if (manager) { | 61 if (manager) { |
| 62 // These objects will delete themselves when the dialog closes. | 62 // These objects will delete themselves when the dialog closes. |
| 63 new DevicePermissionsDialogController(web_contents(), prompt()); | 63 new DevicePermissionsDialogController(web_contents(), prompt()); |
| 64 } else { | 64 } else { |
| 65 base::ThreadTaskRunnerHandle::Get()->PostTask( | 65 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 66 FROM_HERE, | 66 FROM_HERE, |
| 67 base::Bind(&DevicePermissionsPrompt::Prompt::Dismissed, prompt())); | 67 base::Bind(&DevicePermissionsPrompt::Prompt::Dismissed, prompt())); |
| 68 } | 68 } |
| 69 } | 69 } |
| OLD | NEW |