| 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/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 content::WebContents* source, | 270 content::WebContents* source, |
| 271 const content::OpenURLParams& params) { | 271 const content::OpenURLParams& params) { |
| 272 content::WebContents* new_contents = NULL; | 272 content::WebContents* new_contents = NULL; |
| 273 if (delegate_ && | 273 if (delegate_ && |
| 274 delegate_->HandleOpenURLFromTab(source, params, &new_contents)) { | 274 delegate_->HandleOpenURLFromTab(source, params, &new_contents)) { |
| 275 return new_contents; | 275 return new_contents; |
| 276 } | 276 } |
| 277 return WebDialogWebContentsDelegate::OpenURLFromTab(source, params); | 277 return WebDialogWebContentsDelegate::OpenURLFromTab(source, params); |
| 278 } | 278 } |
| 279 | 279 |
| 280 void WebDialogView::AddNewContents(content::WebContents* source, | 280 bool WebDialogView::AddNewContents(content::WebContents* source, |
| 281 content::WebContents* new_contents, | 281 content::WebContents* new_contents, |
| 282 WindowOpenDisposition disposition, | 282 WindowOpenDisposition disposition, |
| 283 const gfx::Rect& initial_pos, | 283 const gfx::Rect& initial_pos, |
| 284 bool user_gesture) { | 284 bool user_gesture) { |
| 285 if (delegate_ && delegate_->HandleAddNewContents( | 285 if (delegate_ && delegate_->HandleAddNewContents( |
| 286 source, new_contents, disposition, initial_pos, user_gesture)) { | 286 source, new_contents, disposition, initial_pos, user_gesture)) { |
| 287 return; | 287 return true; |
| 288 } | 288 } |
| 289 WebDialogWebContentsDelegate::AddNewContents( | 289 return WebDialogWebContentsDelegate::AddNewContents( |
| 290 source, new_contents, disposition, initial_pos, user_gesture); | 290 source, new_contents, disposition, initial_pos, user_gesture); |
| 291 } | 291 } |
| 292 | 292 |
| 293 void WebDialogView::LoadingStateChanged(content::WebContents* source) { | 293 void WebDialogView::LoadingStateChanged(content::WebContents* source) { |
| 294 if (delegate_) | 294 if (delegate_) |
| 295 delegate_->OnLoadingStateChanged(source); | 295 delegate_->OnLoadingStateChanged(source); |
| 296 } | 296 } |
| 297 | 297 |
| 298 //////////////////////////////////////////////////////////////////////////////// | 298 //////////////////////////////////////////////////////////////////////////////// |
| 299 // WebDialogView, private: | 299 // WebDialogView, private: |
| (...skipping 13 matching lines...) Expand all Loading... |
| 313 gfx::Size out; | 313 gfx::Size out; |
| 314 delegate_->GetDialogSize(&out); | 314 delegate_->GetDialogSize(&out); |
| 315 if (!out.IsEmpty() && GetWidget()) | 315 if (!out.IsEmpty() && GetWidget()) |
| 316 GetWidget()->CenterWindow(out); | 316 GetWidget()->CenterWindow(out); |
| 317 } | 317 } |
| 318 | 318 |
| 319 web_view_->LoadInitialURL(GetDialogContentURL()); | 319 web_view_->LoadInitialURL(GetDialogContentURL()); |
| 320 } | 320 } |
| 321 | 321 |
| 322 } // namespace views | 322 } // namespace views |
| OLD | NEW |