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

Side by Side Diff: chrome/browser/printing/print_dialog_cloud.cc

Issue 9473001: Extract minimal RenderViewHost interface for embedders, leaving (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to LKGR. Created 8 years, 9 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 | Annotate | Revision Log
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 "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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 if (type == content::NOTIFICATION_LOAD_STOP) { 342 if (type == content::NOTIFICATION_LOAD_STOP) {
343 // Take the opportunity to set some (minimal) additional 343 // Take the opportunity to set some (minimal) additional
344 // script permissions required for the web UI. 344 // script permissions required for the web UI.
345 GURL url = web_ui()->GetWebContents()->GetURL(); 345 GURL url = web_ui()->GetWebContents()->GetURL();
346 GURL dialog_url = CloudPrintURL( 346 GURL dialog_url = CloudPrintURL(
347 Profile::FromWebUI(web_ui())).GetCloudPrintServiceDialogURL(); 347 Profile::FromWebUI(web_ui())).GetCloudPrintServiceDialogURL();
348 if (url.host() == dialog_url.host() && 348 if (url.host() == dialog_url.host() &&
349 url.path() == dialog_url.path() && 349 url.path() == dialog_url.path() &&
350 url.scheme() == dialog_url.scheme()) { 350 url.scheme() == dialog_url.scheme()) {
351 RenderViewHost* rvh = web_ui()->GetWebContents()->GetRenderViewHost(); 351 RenderViewHost* rvh = web_ui()->GetWebContents()->GetRenderViewHost();
352 if (rvh && rvh->delegate()) { 352 if (rvh && rvh->GetDelegate()) {
353 WebPreferences webkit_prefs = rvh->delegate()->GetWebkitPrefs(); 353 WebPreferences webkit_prefs = rvh->GetDelegate()->GetWebkitPrefs();
354 webkit_prefs.allow_scripts_to_close_windows = true; 354 webkit_prefs.allow_scripts_to_close_windows = true;
355 rvh->UpdateWebkitPreferences(webkit_prefs); 355 rvh->UpdateWebkitPreferences(webkit_prefs);
356 } else { 356 } else {
357 DCHECK(false); 357 DCHECK(false);
358 } 358 }
359 } 359 }
360 360
361 // Choose one or the other. If you need to debug, bring up the 361 // Choose one or the other. If you need to debug, bring up the
362 // debugger. You can then use the various chrome.send() 362 // debugger. You can then use the various chrome.send()
363 // registrations above to kick of the various function calls, 363 // registrations above to kick of the various function calls,
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 file_type, 808 file_type,
809 false, 809 false,
810 delete_on_close); 810 delete_on_close);
811 return true; 811 return true;
812 } 812 }
813 } 813 }
814 return false; 814 return false;
815 } 815 }
816 816
817 } // end namespace 817 } // end namespace
OLDNEW
« no previous file with comments | « chrome/browser/printing/background_printing_manager.cc ('k') | chrome/browser/printing/print_preview_tab_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698