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

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

Issue 250943008: Move enum MenuAnchorPosition to reduce deps on menu_item_view.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix indent Created 6 years, 7 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/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
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 views::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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698