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/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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 return; | 446 return; |
447 | 447 |
448 // Only show context menu if point is in caption. | 448 // Only show context menu if point is in caption. |
449 gfx::Point point_in_view_coords(p); | 449 gfx::Point point_in_view_coords(p); |
450 views::View::ConvertPointFromScreen(widget()->non_client_view(), | 450 views::View::ConvertPointFromScreen(widget()->non_client_view(), |
451 &point_in_view_coords); | 451 &point_in_view_coords); |
452 int hit_test = | 452 int hit_test = |
453 widget()->non_client_view()->NonClientHitTest(point_in_view_coords); | 453 widget()->non_client_view()->NonClientHitTest(point_in_view_coords); |
454 if (hit_test == HTCAPTION) { | 454 if (hit_test == HTCAPTION) { |
455 menu_runner_.reset(new views::MenuRunner(model.get())); | 455 menu_runner_.reset(new views::MenuRunner(model.get())); |
456 if (menu_runner_->RunMenuAt(source->GetWidget(), NULL, | 456 if (menu_runner_->RunMenuAt(source->GetWidget(), |
457 gfx::Rect(p, gfx::Size(0,0)), views::MenuItemView::TOPLEFT, | 457 NULL, |
458 source_type, | 458 gfx::Rect(p, gfx::Size(0, 0)), |
459 views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == | 459 views::MENU_ANCHOR_TOPLEFT, |
460 views::MenuRunner::MENU_DELETED) | 460 source_type, |
| 461 views::MenuRunner::HAS_MNEMONICS | |
| 462 views::MenuRunner::CONTEXT_MENU) == |
| 463 views::MenuRunner::MENU_DELETED) { |
461 return; | 464 return; |
| 465 } |
462 } | 466 } |
463 #endif | 467 #endif |
464 } | 468 } |
465 | 469 |
466 // views::WidgetDelegate implementation. | 470 // views::WidgetDelegate implementation. |
467 | 471 |
468 gfx::ImageSkia ChromeNativeAppWindowViews::GetWindowAppIcon() { | 472 gfx::ImageSkia ChromeNativeAppWindowViews::GetWindowAppIcon() { |
469 gfx::Image app_icon = app_window()->app_icon(); | 473 gfx::Image app_icon = app_window()->app_icon(); |
470 if (app_icon.IsEmpty()) | 474 if (app_icon.IsEmpty()) |
471 return GetWindowIcon(); | 475 return GetWindowIcon(); |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 InitializePanelWindow(create_params); | 684 InitializePanelWindow(create_params); |
681 } else { | 685 } else { |
682 InitializeDefaultWindow(create_params); | 686 InitializeDefaultWindow(create_params); |
683 } | 687 } |
684 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews( | 688 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews( |
685 Profile::FromBrowserContext(app_window->browser_context()), | 689 Profile::FromBrowserContext(app_window->browser_context()), |
686 widget()->GetFocusManager(), | 690 widget()->GetFocusManager(), |
687 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY, | 691 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY, |
688 NULL)); | 692 NULL)); |
689 } | 693 } |
OLD | NEW |