| 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 #include "chrome/browser/ui/views/extensions/device_permissions_dialog_view.h" | 5 #include "chrome/browser/ui/views/extensions/device_permissions_dialog_view.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/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 } | 152 } |
| 153 | 153 |
| 154 base::string16 DevicePermissionsDialogView::GetWindowTitle() const { | 154 base::string16 DevicePermissionsDialogView::GetWindowTitle() const { |
| 155 return prompt_->GetHeading(); | 155 return prompt_->GetHeading(); |
| 156 } | 156 } |
| 157 | 157 |
| 158 gfx::Size DevicePermissionsDialogView::GetPreferredSize() const { | 158 gfx::Size DevicePermissionsDialogView::GetPreferredSize() const { |
| 159 return gfx::Size(500, 250); | 159 return gfx::Size(500, 250); |
| 160 } | 160 } |
| 161 | 161 |
| 162 void ChromeDevicePermissionsPrompt::ShowDialog() { | 162 void ChromeDevicePermissionsPrompt::ShowDialogViews() { |
| 163 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 163 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 164 | 164 |
| 165 web_modal::WebContentsModalDialogManager* manager = | 165 web_modal::WebContentsModalDialogManager* manager = |
| 166 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents()); | 166 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents()); |
| 167 if (manager) { | 167 if (manager) { |
| 168 constrained_window::ShowWebModalDialogViews( | 168 constrained_window::ShowWebModalDialogViews( |
| 169 new DevicePermissionsDialogView(prompt()), web_contents()); | 169 new DevicePermissionsDialogView(prompt()), web_contents()); |
| 170 } else { | 170 } else { |
| 171 base::ThreadTaskRunnerHandle::Get()->PostTask( | 171 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 172 FROM_HERE, | 172 FROM_HERE, |
| 173 base::Bind(&DevicePermissionsPrompt::Prompt::Dismissed, prompt())); | 173 base::Bind(&DevicePermissionsPrompt::Prompt::Dismissed, prompt())); |
| 174 } | 174 } |
| 175 } | 175 } |
| OLD | NEW |