| 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 "chrome/browser/printing/print_dialog_cloud.h" | 5 #include "chrome/browser/printing/print_dialog_cloud.h" |
| 6 #include "chrome/browser/printing/print_dialog_cloud_internal.h" | 6 #include "chrome/browser/printing/print_dialog_cloud_internal.h" |
| 7 | 7 |
| 8 #include "base/base64.h" | 8 #include "base/base64.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 // Take the opportunity to set some (minimal) additional | 350 // Take the opportunity to set some (minimal) additional |
| 351 // script permissions required for the web UI. | 351 // script permissions required for the web UI. |
| 352 GURL url = web_ui()->GetWebContents()->GetURL(); | 352 GURL url = web_ui()->GetWebContents()->GetURL(); |
| 353 GURL dialog_url = CloudPrintURL( | 353 GURL dialog_url = CloudPrintURL( |
| 354 Profile::FromWebUI(web_ui())).GetCloudPrintServiceDialogURL(); | 354 Profile::FromWebUI(web_ui())).GetCloudPrintServiceDialogURL(); |
| 355 if (url.host() == dialog_url.host() && | 355 if (url.host() == dialog_url.host() && |
| 356 url.path() == dialog_url.path() && | 356 url.path() == dialog_url.path() && |
| 357 url.scheme() == dialog_url.scheme()) { | 357 url.scheme() == dialog_url.scheme()) { |
| 358 RenderViewHost* rvh = web_ui()->GetWebContents()->GetRenderViewHost(); | 358 RenderViewHost* rvh = web_ui()->GetWebContents()->GetRenderViewHost(); |
| 359 if (rvh && rvh->GetDelegate()) { | 359 if (rvh && rvh->GetDelegate()) { |
| 360 WebPreferences webkit_prefs = rvh->GetDelegate()->GetWebkitPrefs(); | 360 webkit_glue::WebPreferences webkit_prefs = |
| 361 rvh->GetDelegate()->GetWebkitPrefs(); |
| 361 webkit_prefs.allow_scripts_to_close_windows = true; | 362 webkit_prefs.allow_scripts_to_close_windows = true; |
| 362 rvh->UpdateWebkitPreferences(webkit_prefs); | 363 rvh->UpdateWebkitPreferences(webkit_prefs); |
| 363 } else { | 364 } else { |
| 364 DCHECK(false); | 365 DCHECK(false); |
| 365 } | 366 } |
| 366 } | 367 } |
| 367 | 368 |
| 368 // Choose one or the other. If you need to debug, bring up the | 369 // Choose one or the other. If you need to debug, bring up the |
| 369 // debugger. You can then use the various chrome.send() | 370 // debugger. You can then use the various chrome.send() |
| 370 // registrations above to kick of the various function calls, | 371 // registrations above to kick of the various function calls, |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 file_type, | 800 file_type, |
| 800 false, | 801 false, |
| 801 delete_on_close); | 802 delete_on_close); |
| 802 return true; | 803 return true; |
| 803 } | 804 } |
| 804 } | 805 } |
| 805 return false; | 806 return false; |
| 806 } | 807 } |
| 807 | 808 |
| 808 } // end namespace | 809 } // end namespace |
| OLD | NEW |