| 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 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 if (source != &menu_model_) | 344 if (source != &menu_model_) |
| 345 return; | 345 return; |
| 346 | 346 |
| 347 content::RenderWidgetHostView* view = | 347 content::RenderWidgetHostView* view = |
| 348 source_web_contents_->GetRenderWidgetHostView(); | 348 source_web_contents_->GetRenderWidgetHostView(); |
| 349 if (view) | 349 if (view) |
| 350 view->SetShowingContextMenu(false); | 350 view->SetShowingContextMenu(false); |
| 351 source_web_contents_->NotifyContextMenuClosed(params_.custom_context); | 351 source_web_contents_->NotifyContextMenuClosed(params_.custom_context); |
| 352 | 352 |
| 353 if (!command_executed_) { | 353 if (!command_executed_) { |
| 354 FOR_EACH_OBSERVER(RenderViewContextMenuObserver, | 354 for (auto& observer : observers_) |
| 355 observers_, | 355 observer.OnMenuCancel(); |
| 356 OnMenuCancel()); | |
| 357 } | 356 } |
| 358 } | 357 } |
| 359 | 358 |
| 360 RenderFrameHost* RenderViewContextMenuBase::GetRenderFrameHost() { | 359 RenderFrameHost* RenderViewContextMenuBase::GetRenderFrameHost() { |
| 361 return RenderFrameHost::FromID(render_process_id_, render_frame_id_); | 360 return RenderFrameHost::FromID(render_process_id_, render_frame_id_); |
| 362 } | 361 } |
| 363 | 362 |
| 364 // Controller functions -------------------------------------------------------- | 363 // Controller functions -------------------------------------------------------- |
| 365 | 364 |
| 366 void RenderViewContextMenuBase::OpenURL(const GURL& url, | 365 void RenderViewContextMenuBase::OpenURL(const GURL& url, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 NotifyURLOpened(url, new_contents); | 398 NotifyURLOpened(url, new_contents); |
| 400 } | 399 } |
| 401 | 400 |
| 402 bool RenderViewContextMenuBase::IsCustomItemChecked(int id) const { | 401 bool RenderViewContextMenuBase::IsCustomItemChecked(int id) const { |
| 403 return IsCustomItemCheckedInternal(params_.custom_items, id); | 402 return IsCustomItemCheckedInternal(params_.custom_items, id); |
| 404 } | 403 } |
| 405 | 404 |
| 406 bool RenderViewContextMenuBase::IsCustomItemEnabled(int id) const { | 405 bool RenderViewContextMenuBase::IsCustomItemEnabled(int id) const { |
| 407 return IsCustomItemEnabledInternal(params_.custom_items, id); | 406 return IsCustomItemEnabledInternal(params_.custom_items, id); |
| 408 } | 407 } |
| OLD | NEW |