| OLD | NEW |
| 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 "chrome/browser/ui/views/extensions/media_galleries_dialog_views.h" | 5 #include "chrome/browser/ui/views/extensions/media_galleries_dialog_views.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/ui/views/extensions/media_gallery_checkbox_view.h" | 8 #include "chrome/browser/ui/views/extensions/media_gallery_checkbox_view.h" |
| 9 #include "components/web_modal/web_contents_modal_dialog_host.h" | 9 #include "components/web_modal/web_contents_modal_dialog_host.h" |
| 10 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 10 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 } | 317 } |
| 318 } | 318 } |
| 319 | 319 |
| 320 void MediaGalleriesDialogViews::ShowContextMenu(const gfx::Point& point, | 320 void MediaGalleriesDialogViews::ShowContextMenu(const gfx::Point& point, |
| 321 ui::MenuSourceType source_type, | 321 ui::MenuSourceType source_type, |
| 322 GalleryDialogId id) { | 322 GalleryDialogId id) { |
| 323 context_menu_runner_.reset(new views::MenuRunner( | 323 context_menu_runner_.reset(new views::MenuRunner( |
| 324 controller_->GetContextMenu(id))); | 324 controller_->GetContextMenu(id))); |
| 325 | 325 |
| 326 if (context_menu_runner_->RunMenuAt( | 326 if (context_menu_runner_->RunMenuAt( |
| 327 GetWidget(), NULL, gfx::Rect(point.x(), point.y(), 0, 0), | 327 GetWidget(), |
| 328 views::MenuItemView::TOPLEFT, source_type, | 328 NULL, |
| 329 gfx::Rect(point.x(), point.y(), 0, 0), |
| 330 ui::MENU_ANCHOR_TOPLEFT, |
| 331 source_type, |
| 329 views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == | 332 views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == |
| 330 views::MenuRunner::MENU_DELETED) { | 333 views::MenuRunner::MENU_DELETED) { |
| 331 return; | 334 return; |
| 332 } | 335 } |
| 333 } | 336 } |
| 334 | 337 |
| 335 bool MediaGalleriesDialogViews::ControllerHasWebContents() const { | 338 bool MediaGalleriesDialogViews::ControllerHasWebContents() const { |
| 336 return controller_->web_contents() != NULL; | 339 return controller_->web_contents() != NULL; |
| 337 } | 340 } |
| 338 | 341 |
| 339 // MediaGalleriesDialogViewsController ----------------------------------------- | 342 // MediaGalleriesDialogViewsController ----------------------------------------- |
| 340 | 343 |
| 341 // static | 344 // static |
| 342 MediaGalleriesDialog* MediaGalleriesDialog::Create( | 345 MediaGalleriesDialog* MediaGalleriesDialog::Create( |
| 343 MediaGalleriesDialogController* controller) { | 346 MediaGalleriesDialogController* controller) { |
| 344 return new MediaGalleriesDialogViews(controller); | 347 return new MediaGalleriesDialogViews(controller); |
| 345 } | 348 } |
| OLD | NEW |