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

Side by Side Diff: chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc

Issue 2334613003: Re-write many calls to WrapUnique() with MakeUnique() (Closed)
Patch Set: Changes from review by sky Created 4 years, 3 months 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 5
6 #include "chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.h" 6 #include "chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.h"
7 7
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 if (!pending_menu_) 62 if (!pending_menu_)
63 return false; 63 return false;
64 64
65 // Pass it to embedder. 65 // Pass it to embedder.
66 int request_id = ++pending_context_menu_request_id_; 66 int request_id = ++pending_context_menu_request_id_;
67 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue()); 67 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue());
68 std::unique_ptr<base::ListValue> items = 68 std::unique_ptr<base::ListValue> items =
69 MenuModelToValue(pending_menu_->menu_model()); 69 MenuModelToValue(pending_menu_->menu_model());
70 args->Set(webview::kContextMenuItems, items.release()); 70 args->Set(webview::kContextMenuItems, items.release());
71 args->SetInteger(webview::kRequestId, request_id); 71 args->SetInteger(webview::kRequestId, request_id);
72 web_view_guest()->DispatchEventToView(base::WrapUnique( 72 web_view_guest()->DispatchEventToView(base::MakeUnique<GuestViewEvent>(
73 new GuestViewEvent(webview::kEventContextMenuShow, std::move(args)))); 73 webview::kEventContextMenuShow, std::move(args)));
74 return true; 74 return true;
75 } 75 }
76 76
77 void ChromeWebViewGuestDelegate::OnDidInitialize() { 77 void ChromeWebViewGuestDelegate::OnDidInitialize() {
78 #if defined(OS_CHROMEOS) 78 #if defined(OS_CHROMEOS)
79 if (chrome::IsRunningInMash()) { 79 if (chrome::IsRunningInMash()) {
80 NOTIMPLEMENTED(); 80 NOTIMPLEMENTED();
81 return; 81 return;
82 } 82 }
83 chromeos::AccessibilityManager* accessibility_manager = 83 chromeos::AccessibilityManager* accessibility_manager =
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 159
160 void ChromeWebViewGuestDelegate::SetContextMenuPosition( 160 void ChromeWebViewGuestDelegate::SetContextMenuPosition(
161 const gfx::Point& position) { 161 const gfx::Point& position) {
162 if (context_menu_position_ == nullptr) 162 if (context_menu_position_ == nullptr)
163 context_menu_position_.reset(new gfx::Point()); 163 context_menu_position_.reset(new gfx::Point());
164 164
165 *context_menu_position_ = position; 165 *context_menu_position_ = position;
166 } 166 }
167 167
168 } // namespace extensions 168 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/geolocation/geolocation_permission_context_unittest.cc ('k') | chrome/browser/history/chrome_history_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698