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 "components/renderer_context_menu/render_view_context_menu_base.h" | 5 #include "components/renderer_context_menu/render_view_context_menu_base.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 RenderViewContextMenuBase::~RenderViewContextMenuBase() { | 165 RenderViewContextMenuBase::~RenderViewContextMenuBase() { |
166 } | 166 } |
167 | 167 |
168 // Menu construction functions ------------------------------------------------- | 168 // Menu construction functions ------------------------------------------------- |
169 | 169 |
170 void RenderViewContextMenuBase::Init() { | 170 void RenderViewContextMenuBase::Init() { |
171 // Command id range must have been already initializerd. | 171 // Command id range must have been already initializerd. |
172 DCHECK_NE(-1, content_context_custom_first); | 172 DCHECK_NE(-1, content_context_custom_first); |
173 DCHECK_NE(-1, content_context_custom_last); | 173 DCHECK_NE(-1, content_context_custom_last); |
174 | 174 |
| 175 CalculateScreenCoordinatesInParams(); |
| 176 |
175 InitMenu(); | 177 InitMenu(); |
176 if (toolkit_delegate_) | 178 if (toolkit_delegate_) |
177 toolkit_delegate_->Init(&menu_model_); | 179 toolkit_delegate_->Init(&menu_model_); |
178 } | 180 } |
179 | 181 |
180 void RenderViewContextMenuBase::Cancel() { | 182 void RenderViewContextMenuBase::Cancel() { |
181 if (toolkit_delegate_) | 183 if (toolkit_delegate_) |
182 toolkit_delegate_->Cancel(); | 184 toolkit_delegate_->Cancel(); |
183 } | 185 } |
184 | 186 |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 } | 382 } |
381 | 383 |
382 bool RenderViewContextMenuBase::IsCustomItemChecked(int id) const { | 384 bool RenderViewContextMenuBase::IsCustomItemChecked(int id) const { |
383 return IsCustomItemCheckedInternal(params_.custom_items, id); | 385 return IsCustomItemCheckedInternal(params_.custom_items, id); |
384 } | 386 } |
385 | 387 |
386 bool RenderViewContextMenuBase::IsCustomItemEnabled(int id) const { | 388 bool RenderViewContextMenuBase::IsCustomItemEnabled(int id) const { |
387 return IsCustomItemEnabledInternal(params_.custom_items, id); | 389 return IsCustomItemEnabledInternal(params_.custom_items, id); |
388 } | 390 } |
389 | 391 |
OLD | NEW |