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

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

Issue 1303773002: Give the main frame a RenderWidget. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: plumb through surface ID *and* widget surface ID for window.open Created 5 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 (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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 327
328 void WebDialogView::BeforeUnloadFired(content::WebContents* tab, 328 void WebDialogView::BeforeUnloadFired(content::WebContents* tab,
329 bool proceed, 329 bool proceed,
330 bool* proceed_to_fire_unload) { 330 bool* proceed_to_fire_unload) {
331 before_unload_fired_ = true; 331 before_unload_fired_ = true;
332 *proceed_to_fire_unload = proceed; 332 *proceed_to_fire_unload = proceed;
333 } 333 }
334 334
335 bool WebDialogView::ShouldCreateWebContents( 335 bool WebDialogView::ShouldCreateWebContents(
336 content::WebContents* web_contents, 336 content::WebContents* web_contents,
337 int route_id, 337 int32 route_id,
338 int main_frame_route_id, 338 int32 main_frame_route_id,
339 int32 main_frame_widget_route_id,
340 int32 surface_id,
339 WindowContainerType window_container_type, 341 WindowContainerType window_container_type,
340 const std::string& frame_name, 342 const std::string& frame_name,
341 const GURL& target_url, 343 const GURL& target_url,
342 const std::string& partition_id, 344 const std::string& partition_id,
343 content::SessionStorageNamespace* session_storage_namespace) { 345 content::SessionStorageNamespace* session_storage_namespace) {
344 if (delegate_) 346 if (delegate_)
345 return delegate_->HandleShouldCreateWebContents(); 347 return delegate_->HandleShouldCreateWebContents();
346 return true; 348 return true;
347 } 349 }
348 350
349 //////////////////////////////////////////////////////////////////////////////// 351 ////////////////////////////////////////////////////////////////////////////////
350 // WebDialogView, private: 352 // WebDialogView, private:
351 353
352 void WebDialogView::InitDialog() { 354 void WebDialogView::InitDialog() {
353 content::WebContents* web_contents = web_view_->GetWebContents(); 355 content::WebContents* web_contents = web_view_->GetWebContents();
354 if (web_contents->GetDelegate() == this) 356 if (web_contents->GetDelegate() == this)
355 return; 357 return;
356 358
357 web_contents->SetDelegate(this); 359 web_contents->SetDelegate(this);
358 360
359 // Set the delegate. This must be done before loading the page. See 361 // Set the delegate. This must be done before loading the page. See
360 // the comment above WebDialogUI in its header file for why. 362 // the comment above WebDialogUI in its header file for why.
361 WebDialogUI::SetDelegate(web_contents, this); 363 WebDialogUI::SetDelegate(web_contents, this);
362 364
363 web_view_->LoadInitialURL(GetDialogContentURL()); 365 web_view_->LoadInitialURL(GetDialogContentURL());
364 } 366 }
365 367
366 } // namespace views 368 } // namespace views
OLDNEW
« content/public/test/render_view_test.cc ('K') | « ui/views/controls/webview/web_dialog_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698