OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "content/shell/browser/shell_web_contents_view_delegate.h" | 5 #include "content/shell/browser/shell_web_contents_view_delegate.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "content/public/browser/web_contents.h" | 8 #include "content/public/browser/web_contents.h" |
9 #include "content/shell/browser/shell_devtools_frontend.h" | 9 #include "content/shell/browser/shell_devtools_frontend.h" |
10 #include "content/shell/common/shell_switches.h" | 10 #include "content/shell/common/shell_switches.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 aura::Window* root_window = web_contents_window->GetRootWindow(); | 80 aura::Window* root_window = web_contents_window->GetRootWindow(); |
81 aura::client::ScreenPositionClient* screen_position_client = | 81 aura::client::ScreenPositionClient* screen_position_client = |
82 aura::client::GetScreenPositionClient(root_window); | 82 aura::client::GetScreenPositionClient(root_window); |
83 if (screen_position_client) { | 83 if (screen_position_client) { |
84 screen_position_client->ConvertPointToScreen(web_contents_window, | 84 screen_position_client->ConvertPointToScreen(web_contents_window, |
85 &screen_point); | 85 &screen_point); |
86 } | 86 } |
87 | 87 |
88 context_menu_model_.reset(new ContextMenuModel(web_contents_, params)); | 88 context_menu_model_.reset(new ContextMenuModel(web_contents_, params)); |
89 context_menu_runner_.reset(new views::MenuRunner( | 89 context_menu_runner_.reset(new views::MenuRunner( |
90 context_menu_model_.get(), | 90 context_menu_model_.get(), views::MenuRunner::CONTEXT_MENU)); |
91 views::MenuRunner::CONTEXT_MENU | views::MenuRunner::ASYNC)); | |
92 | 91 |
93 views::Widget* widget = views::Widget::GetWidgetForNativeView( | 92 views::Widget* widget = views::Widget::GetWidgetForNativeView( |
94 web_contents_->GetTopLevelNativeWindow()); | 93 web_contents_->GetTopLevelNativeWindow()); |
95 context_menu_runner_->RunMenuAt( | 94 context_menu_runner_->RunMenuAt( |
96 widget, nullptr, gfx::Rect(screen_point, gfx::Size()), | 95 widget, nullptr, gfx::Rect(screen_point, gfx::Size()), |
97 views::MENU_ANCHOR_TOPRIGHT, ui::MENU_SOURCE_NONE); | 96 views::MENU_ANCHOR_TOPRIGHT, ui::MENU_SOURCE_NONE); |
98 } | 97 } |
99 | 98 |
100 } // namespace content | 99 } // namespace content |
OLD | NEW |