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/cocoa/renderer_context_menu/render_view_context_menu
_mac.h" | 5 #include "chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu
_mac.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 // Relies on the tag being set to the command id. | 179 // Relies on the tag being set to the command id. |
180 | 180 |
181 RenderViewContextMenuMac::RenderViewContextMenuMac( | 181 RenderViewContextMenuMac::RenderViewContextMenuMac( |
182 content::RenderFrameHost* render_frame_host, | 182 content::RenderFrameHost* render_frame_host, |
183 const content::ContextMenuParams& params, | 183 const content::ContextMenuParams& params, |
184 NSView* parent_view) | 184 NSView* parent_view) |
185 : RenderViewContextMenu(render_frame_host, params), | 185 : RenderViewContextMenu(render_frame_host, params), |
186 speech_submenu_model_(this), | 186 speech_submenu_model_(this), |
187 bidi_submenu_model_(this), | 187 bidi_submenu_model_(this), |
188 parent_view_(parent_view) { | 188 parent_view_(parent_view) { |
189 scoped_ptr<ToolkitDelegate> delegate(new ToolkitDelegateMac(this)); | 189 std::unique_ptr<ToolkitDelegate> delegate(new ToolkitDelegateMac(this)); |
190 set_toolkit_delegate(std::move(delegate)); | 190 set_toolkit_delegate(std::move(delegate)); |
191 } | 191 } |
192 | 192 |
193 RenderViewContextMenuMac::~RenderViewContextMenuMac() { | 193 RenderViewContextMenuMac::~RenderViewContextMenuMac() { |
194 } | 194 } |
195 | 195 |
196 void RenderViewContextMenuMac::Show() { | 196 void RenderViewContextMenuMac::Show() { |
197 menu_controller_.reset( | 197 menu_controller_.reset( |
198 [[MenuController alloc] initWithModel:&menu_model_ | 198 [[MenuController alloc] initWithModel:&menu_model_ |
199 useWithPopUpButtonCell:NO]); | 199 useWithPopUpButtonCell:NO]); |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 if (view) | 438 if (view) |
439 view->SpeakSelection(); | 439 view->SpeakSelection(); |
440 } | 440 } |
441 | 441 |
442 void RenderViewContextMenuMac::StopSpeaking() { | 442 void RenderViewContextMenuMac::StopSpeaking() { |
443 content::RenderWidgetHostView* view = | 443 content::RenderWidgetHostView* view = |
444 GetRenderViewHost()->GetWidget()->GetView(); | 444 GetRenderViewHost()->GetWidget()->GetView(); |
445 if (view) | 445 if (view) |
446 view->StopSpeaking(); | 446 view->StopSpeaking(); |
447 } | 447 } |
OLD | NEW |