Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc

Issue 148093011: Abstract media galleries context menu code and use it in scan result dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits & rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/constrained_window_views.h" 8 #include "chrome/browser/ui/views/constrained_window_views.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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 ShowContextMenu(point, source_type, iter->first); 362 ShowContextMenu(point, source_type, iter->first);
363 return; 363 return;
364 } 364 }
365 } 365 }
366 } 366 }
367 367
368 void MediaGalleriesDialogViews::ShowContextMenu(const gfx::Point& point, 368 void MediaGalleriesDialogViews::ShowContextMenu(const gfx::Point& point,
369 ui::MenuSourceType source_type, 369 ui::MenuSourceType source_type,
370 MediaGalleryPrefId id) { 370 MediaGalleryPrefId id) {
371 context_menu_runner_.reset(new views::MenuRunner( 371 context_menu_runner_.reset(new views::MenuRunner(
372 controller_->GetContextMenuModel(id))); 372 controller_->GetContextMenu(id)));
373 373
374 if (context_menu_runner_->RunMenuAt( 374 if (context_menu_runner_->RunMenuAt(
375 GetWidget(), NULL, gfx::Rect(point.x(), point.y(), 0, 0), 375 GetWidget(), NULL, gfx::Rect(point.x(), point.y(), 0, 0),
376 views::MenuItemView::TOPLEFT, source_type, 376 views::MenuItemView::TOPLEFT, source_type,
377 views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == 377 views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) ==
378 views::MenuRunner::MENU_DELETED) { 378 views::MenuRunner::MENU_DELETED) {
379 return; 379 return;
380 } 380 }
381 } 381 }
382 382
383 // MediaGalleriesDialogViewsController ----------------------------------------- 383 // MediaGalleriesDialogViewsController -----------------------------------------
384 384
385 // static 385 // static
386 MediaGalleriesDialog* MediaGalleriesDialog::Create( 386 MediaGalleriesDialog* MediaGalleriesDialog::Create(
387 MediaGalleriesDialogController* controller) { 387 MediaGalleriesDialogController* controller) {
388 return new MediaGalleriesDialogViews(controller); 388 return new MediaGalleriesDialogViews(controller);
389 } 389 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698