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

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

Issue 8983010: Convert WebContents to return a content::NavigationController instead of the implementation. Upda... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix mac Created 8 years, 11 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 10 matching lines...) Expand all
21 #include "chrome/browser/profiles/profile_manager.h" 21 #include "chrome/browser/profiles/profile_manager.h"
22 #include "chrome/browser/ui/browser_dialogs.h" 22 #include "chrome/browser/ui/browser_dialogs.h"
23 #include "chrome/browser/ui/browser_list.h" 23 #include "chrome/browser/ui/browser_list.h"
24 #include "chrome/browser/ui/dialog_style.h" 24 #include "chrome/browser/ui/dialog_style.h"
25 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 25 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
26 #include "chrome/common/chrome_switches.h" 26 #include "chrome/common/chrome_switches.h"
27 #include "chrome/common/pref_names.h" 27 #include "chrome/common/pref_names.h"
28 #include "chrome/common/print_messages.h" 28 #include "chrome/common/print_messages.h"
29 #include "chrome/common/url_constants.h" 29 #include "chrome/common/url_constants.h"
30 #include "content/browser/renderer_host/render_view_host.h" 30 #include "content/browser/renderer_host/render_view_host.h"
31 #include "content/browser/tab_contents/navigation_controller.h"
32 #include "content/browser/tab_contents/tab_contents_view.h" 31 #include "content/browser/tab_contents/tab_contents_view.h"
33 #include "content/browser/webui/web_ui.h" 32 #include "content/browser/webui/web_ui.h"
34 #include "content/public/browser/browser_thread.h" 33 #include "content/public/browser/browser_thread.h"
34 #include "content/public/browser/navigation_controller.h"
35 #include "content/public/browser/navigation_entry.h" 35 #include "content/public/browser/navigation_entry.h"
36 #include "content/public/browser/notification_registrar.h" 36 #include "content/public/browser/notification_registrar.h"
37 #include "content/public/browser/notification_source.h" 37 #include "content/public/browser/notification_source.h"
38 #include "content/public/browser/notification_types.h" 38 #include "content/public/browser/notification_types.h"
39 #include "content/public/browser/web_contents.h" 39 #include "content/public/browser/web_contents.h"
40 #include "ui/base/l10n/l10n_util.h" 40 #include "ui/base/l10n/l10n_util.h"
41 #include "webkit/glue/webpreferences.h" 41 #include "webkit/glue/webpreferences.h"
42 42
43 #include "grit/generated_resources.h" 43 #include "grit/generated_resources.h"
44 44
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 web_ui()->RegisterMessageCallback("SendPrintData", 296 web_ui()->RegisterMessageCallback("SendPrintData",
297 base::Bind(&CloudPrintFlowHandler::HandleSendPrintData, 297 base::Bind(&CloudPrintFlowHandler::HandleSendPrintData,
298 base::Unretained(this))); 298 base::Unretained(this)));
299 web_ui()->RegisterMessageCallback("SetPageParameters", 299 web_ui()->RegisterMessageCallback("SetPageParameters",
300 base::Bind(&CloudPrintFlowHandler::HandleSetPageParameters, 300 base::Bind(&CloudPrintFlowHandler::HandleSetPageParameters,
301 base::Unretained(this))); 301 base::Unretained(this)));
302 302
303 // Register for appropriate notifications, and re-direct the URL 303 // Register for appropriate notifications, and re-direct the URL
304 // to the real server URL, now that we've gotten an HTML dialog 304 // to the real server URL, now that we've gotten an HTML dialog
305 // going. 305 // going.
306 NavigationController* controller = &web_ui()->web_contents()->GetController(); 306 content::NavigationController* controller =
307 &web_ui()->web_contents()->GetController();
307 NavigationEntry* pending_entry = controller->GetPendingEntry(); 308 NavigationEntry* pending_entry = controller->GetPendingEntry();
308 if (pending_entry) { 309 if (pending_entry) {
309 Profile* profile = Profile::FromWebUI(web_ui()); 310 Profile* profile = Profile::FromWebUI(web_ui());
310 pending_entry->SetURL( 311 pending_entry->SetURL(
311 CloudPrintURL(profile).GetCloudPrintServiceDialogURL()); 312 CloudPrintURL(profile).GetCloudPrintServiceDialogURL());
312 } 313 }
313 registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, 314 registrar_.Add(this, content::NOTIFICATION_LOAD_STOP,
314 content::Source<content::NavigationController>(controller)); 315 content::Source<content::NavigationController>(controller));
315 } 316 }
316 317
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 file_type, 724 file_type,
724 false, 725 false,
725 delete_on_close); 726 delete_on_close);
726 return true; 727 return true;
727 } 728 }
728 } 729 }
729 return false; 730 return false;
730 } 731 }
731 732
732 } // end namespace 733 } // end namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698