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

Side by Side Diff: chrome/browser/ui/views/apps/chrome_native_app_window_views.cc

Issue 331993009: MacViews: Run native Cocoa context menus to support Services. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add VIEWS_EXPORT for unit test access Created 6 years, 5 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 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/apps/chrome_native_app_window_views.h" 5 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views.h"
6 6
7 #include "apps/ui/views/app_window_frame_view.h" 7 #include "apps/ui/views/app_window_frame_view.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/app_mode/app_mode_utils.h" 10 #include "chrome/browser/app_mode/app_mode_utils.h"
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 if (!model.get()) 464 if (!model.get())
465 return; 465 return;
466 466
467 // Only show context menu if point is in caption. 467 // Only show context menu if point is in caption.
468 gfx::Point point_in_view_coords(p); 468 gfx::Point point_in_view_coords(p);
469 views::View::ConvertPointFromScreen(widget()->non_client_view(), 469 views::View::ConvertPointFromScreen(widget()->non_client_view(),
470 &point_in_view_coords); 470 &point_in_view_coords);
471 int hit_test = 471 int hit_test =
472 widget()->non_client_view()->NonClientHitTest(point_in_view_coords); 472 widget()->non_client_view()->NonClientHitTest(point_in_view_coords);
473 if (hit_test == HTCAPTION) { 473 if (hit_test == HTCAPTION) {
474 menu_runner_.reset(new views::MenuRunner(model.get())); 474 menu_runner_.reset(new views::MenuRunner(
475 model.get(),
476 views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU));
475 if (menu_runner_->RunMenuAt(source->GetWidget(), 477 if (menu_runner_->RunMenuAt(source->GetWidget(),
476 NULL, 478 NULL,
477 gfx::Rect(p, gfx::Size(0, 0)), 479 gfx::Rect(p, gfx::Size(0, 0)),
478 views::MENU_ANCHOR_TOPLEFT, 480 views::MENU_ANCHOR_TOPLEFT,
479 source_type, 481 source_type) ==
480 views::MenuRunner::HAS_MNEMONICS |
481 views::MenuRunner::CONTEXT_MENU) ==
482 views::MenuRunner::MENU_DELETED) { 482 views::MenuRunner::MENU_DELETED) {
483 return; 483 return;
484 } 484 }
485 } 485 }
486 #endif 486 #endif
487 } 487 }
488 488
489 // views::WidgetDelegate implementation. 489 // views::WidgetDelegate implementation.
490 490
491 gfx::ImageSkia ChromeNativeAppWindowViews::GetWindowAppIcon() { 491 gfx::ImageSkia ChromeNativeAppWindowViews::GetWindowAppIcon() {
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 InitializePanelWindow(create_params); 698 InitializePanelWindow(create_params);
699 } else { 699 } else {
700 InitializeDefaultWindow(create_params); 700 InitializeDefaultWindow(create_params);
701 } 701 }
702 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews( 702 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews(
703 Profile::FromBrowserContext(app_window->browser_context()), 703 Profile::FromBrowserContext(app_window->browser_context()),
704 widget()->GetFocusManager(), 704 widget()->GetFocusManager(),
705 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY, 705 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY,
706 NULL)); 706 NULL));
707 } 707 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698