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/media_galleries_scan_result_dialog_
views.h" | 5 #include "chrome/browser/ui/views/extensions/media_galleries_scan_result_dialog_
views.h" |
6 | 6 |
7 #include "components/web_modal/web_contents_modal_dialog_host.h" | 7 #include "components/web_modal/web_contents_modal_dialog_host.h" |
8 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 8 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
9 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" | 9 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" |
10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 | 318 |
319 if (context_menu_runner_->RunMenuAt( | 319 if (context_menu_runner_->RunMenuAt( |
320 GetWidget(), NULL, gfx::Rect(point.x(), point.y(), 0, 0), | 320 GetWidget(), NULL, gfx::Rect(point.x(), point.y(), 0, 0), |
321 views::MenuItemView::TOPLEFT, source_type, | 321 views::MenuItemView::TOPLEFT, source_type, |
322 views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == | 322 views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == |
323 views::MenuRunner::MENU_DELETED) { | 323 views::MenuRunner::MENU_DELETED) { |
324 return; | 324 return; |
325 } | 325 } |
326 } | 326 } |
327 | 327 |
| 328 void MediaGalleriesScanResultDialogViews::AcceptDialogForTesting() { |
| 329 accepted_ = true; |
| 330 |
| 331 web_modal::WebContentsModalDialogManager* web_contents_modal_dialog_manager = |
| 332 web_modal::WebContentsModalDialogManager::FromWebContents( |
| 333 controller_->web_contents()); |
| 334 DCHECK(web_contents_modal_dialog_manager); |
| 335 web_modal::WebContentsModalDialogManager::TestApi( |
| 336 web_contents_modal_dialog_manager).CloseAllDialogs(); |
| 337 } |
| 338 |
328 // MediaGalleriesScanResultDialogViewsController ------------------------------- | 339 // MediaGalleriesScanResultDialogViewsController ------------------------------- |
329 | 340 |
330 // static | 341 // static |
331 MediaGalleriesScanResultDialog* MediaGalleriesScanResultDialog::Create( | 342 MediaGalleriesScanResultDialog* MediaGalleriesScanResultDialog::Create( |
332 MediaGalleriesScanResultDialogController* controller) { | 343 MediaGalleriesScanResultDialogController* controller) { |
333 return new MediaGalleriesScanResultDialogViews(controller); | 344 return new MediaGalleriesScanResultDialogViews(controller); |
334 } | 345 } |
OLD | NEW |