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

Side by Side Diff: components/renderer_context_menu/render_view_context_menu_base.cc

Issue 678653003: Remove Downcasting RVContextMenuBase in ContextMenuDeleagate implementations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync @toot Created 6 years, 1 month 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
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 "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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698