OLD | NEW |
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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 if (delegate_ && | 299 if (delegate_ && |
300 delegate_->HandleOpenURLFromTab(source, params, &new_contents)) { | 300 delegate_->HandleOpenURLFromTab(source, params, &new_contents)) { |
301 return new_contents; | 301 return new_contents; |
302 } | 302 } |
303 return WebDialogWebContentsDelegate::OpenURLFromTab(source, params); | 303 return WebDialogWebContentsDelegate::OpenURLFromTab(source, params); |
304 } | 304 } |
305 | 305 |
306 void WebDialogView::AddNewContents(content::WebContents* source, | 306 void WebDialogView::AddNewContents(content::WebContents* source, |
307 content::WebContents* new_contents, | 307 content::WebContents* new_contents, |
308 WindowOpenDisposition disposition, | 308 WindowOpenDisposition disposition, |
309 const gfx::Rect& initial_pos, | 309 const gfx::Rect& initial_rect, |
310 bool user_gesture, | 310 bool user_gesture, |
311 bool* was_blocked) { | 311 bool* was_blocked) { |
312 if (delegate_ && delegate_->HandleAddNewContents( | 312 if (delegate_ && delegate_->HandleAddNewContents( |
313 source, new_contents, disposition, initial_pos, user_gesture)) { | 313 source, new_contents, disposition, initial_rect, user_gesture)) { |
314 return; | 314 return; |
315 } | 315 } |
316 WebDialogWebContentsDelegate::AddNewContents( | 316 WebDialogWebContentsDelegate::AddNewContents( |
317 source, new_contents, disposition, initial_pos, user_gesture, | 317 source, new_contents, disposition, initial_rect, user_gesture, |
318 was_blocked); | 318 was_blocked); |
319 } | 319 } |
320 | 320 |
321 void WebDialogView::LoadingStateChanged(content::WebContents* source, | 321 void WebDialogView::LoadingStateChanged(content::WebContents* source, |
322 bool to_different_document) { | 322 bool to_different_document) { |
323 if (delegate_) | 323 if (delegate_) |
324 delegate_->OnLoadingStateChanged(source); | 324 delegate_->OnLoadingStateChanged(source); |
325 } | 325 } |
326 | 326 |
327 void WebDialogView::BeforeUnloadFired(content::WebContents* tab, | 327 void WebDialogView::BeforeUnloadFired(content::WebContents* tab, |
(...skipping 28 matching lines...) Expand all Loading... |
356 web_contents->SetDelegate(this); | 356 web_contents->SetDelegate(this); |
357 | 357 |
358 // Set the delegate. This must be done before loading the page. See | 358 // Set the delegate. This must be done before loading the page. See |
359 // the comment above WebDialogUI in its header file for why. | 359 // the comment above WebDialogUI in its header file for why. |
360 WebDialogUI::SetDelegate(web_contents, this); | 360 WebDialogUI::SetDelegate(web_contents, this); |
361 | 361 |
362 web_view_->LoadInitialURL(GetDialogContentURL()); | 362 web_view_->LoadInitialURL(GetDialogContentURL()); |
363 } | 363 } |
364 | 364 |
365 } // namespace views | 365 } // namespace views |
OLD | NEW |