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

Side by Side Diff: ui/views/controls/webview/web_dialog_view.cc

Issue 2089933002: Context Menu Refactor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixing nits Created 4 years, 5 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/controls/webview/web_dialog_view.h" 5 #include "ui/views/controls/webview/web_dialog_view.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/public/browser/browser_context.h" 10 #include "content/public/browser/browser_context.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 delegate_->OnCloseContents(source, out_close_dialog); 252 delegate_->OnCloseContents(source, out_close_dialog);
253 } 253 }
254 254
255 bool WebDialogView::ShouldShowDialogTitle() const { 255 bool WebDialogView::ShouldShowDialogTitle() const {
256 if (delegate_) 256 if (delegate_)
257 return delegate_->ShouldShowDialogTitle(); 257 return delegate_->ShouldShowDialogTitle();
258 return true; 258 return true;
259 } 259 }
260 260
261 bool WebDialogView::HandleContextMenu( 261 bool WebDialogView::HandleContextMenu(
262 RenderFrameHost* render_frame_host,
262 const content::ContextMenuParams& params) { 263 const content::ContextMenuParams& params) {
263 if (delegate_) 264 if (delegate_)
264 return delegate_->HandleContextMenu(params); 265 return delegate_->HandleContextMenu(params);
265 return WebDialogWebContentsDelegate::HandleContextMenu(params); 266 return WebDialogWebContentsDelegate::HandleContextMenu(
267 render_frame_host, params);
266 } 268 }
267 269
268 //////////////////////////////////////////////////////////////////////////////// 270 ////////////////////////////////////////////////////////////////////////////////
269 // content::WebContentsDelegate implementation: 271 // content::WebContentsDelegate implementation:
270 272
271 void WebDialogView::MoveContents(WebContents* source, const gfx::Rect& pos) { 273 void WebDialogView::MoveContents(WebContents* source, const gfx::Rect& pos) {
272 // The contained web page wishes to resize itself. We let it do this because 274 // The contained web page wishes to resize itself. We let it do this because
273 // if it's a dialog we know about, we trust it not to be mean to the user. 275 // if it's a dialog we know about, we trust it not to be mean to the user.
274 GetWidget()->SetBounds(pos); 276 GetWidget()->SetBounds(pos);
275 } 277 }
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 web_contents->SetDelegate(this); 360 web_contents->SetDelegate(this);
359 361
360 // Set the delegate. This must be done before loading the page. See 362 // Set the delegate. This must be done before loading the page. See
361 // the comment above WebDialogUI in its header file for why. 363 // the comment above WebDialogUI in its header file for why.
362 WebDialogUI::SetDelegate(web_contents, this); 364 WebDialogUI::SetDelegate(web_contents, this);
363 365
364 web_view_->LoadInitialURL(GetDialogContentURL()); 366 web_view_->LoadInitialURL(GetDialogContentURL());
365 } 367 }
366 368
367 } // namespace views 369 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698