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

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

Issue 10796049: Move WebDialogWebContentsDelegate to ui/web_dialogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/constrained_web_dialog_delegate_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_preview_tab_controller.h" 5 #include "chrome/browser/printing/print_preview_tab_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/auto_reset.h" 11 #include "base/auto_reset.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/utf_string_conversions.h" 13 #include "base/utf_string_conversions.h"
14 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/chrome_plugin_service_filter.h" 15 #include "chrome/browser/chrome_plugin_service_filter.h"
16 #include "chrome/browser/printing/print_view_manager.h" 16 #include "chrome/browser/printing/print_view_manager.h"
17 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/ui/browser.h" 18 #include "chrome/browser/ui/browser.h"
19 #include "chrome/browser/ui/browser_finder.h" 19 #include "chrome/browser/ui/browser_finder.h"
20 #include "chrome/browser/ui/browser_navigator.h" 20 #include "chrome/browser/ui/browser_navigator.h"
21 #include "chrome/browser/ui/browser_window.h" 21 #include "chrome/browser/ui/browser_window.h"
22 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" 22 #include "chrome/browser/ui/tab_contents/core_tab_helper.h"
23 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" 23 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h"
24 #include "chrome/browser/ui/tab_contents/tab_contents.h" 24 #include "chrome/browser/ui/tab_contents/tab_contents.h"
25 #include "chrome/browser/ui/tabs/tab_strip_model.h" 25 #include "chrome/browser/ui/tabs/tab_strip_model.h"
26 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h" 26 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h"
27 #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h" 27 #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h"
28 #include "chrome/browser/ui/webui/web_dialog_web_contents_delegate.h"
29 #include "chrome/common/chrome_content_client.h" 28 #include "chrome/common/chrome_content_client.h"
30 #include "chrome/common/chrome_notification_types.h" 29 #include "chrome/common/chrome_notification_types.h"
31 #include "chrome/common/chrome_switches.h" 30 #include "chrome/common/chrome_switches.h"
32 #include "chrome/common/url_constants.h" 31 #include "chrome/common/url_constants.h"
33 #include "content/public/browser/navigation_controller.h" 32 #include "content/public/browser/navigation_controller.h"
34 #include "content/public/browser/navigation_details.h" 33 #include "content/public/browser/navigation_details.h"
35 #include "content/public/browser/navigation_entry.h" 34 #include "content/public/browser/navigation_entry.h"
36 #include "content/public/browser/notification_details.h" 35 #include "content/public/browser/notification_details.h"
37 #include "content/public/browser/notification_source.h" 36 #include "content/public/browser/notification_source.h"
38 #include "content/public/browser/render_process_host.h" 37 #include "content/public/browser/render_process_host.h"
39 #include "content/public/browser/render_view_host.h" 38 #include "content/public/browser/render_view_host.h"
40 #include "content/public/browser/web_contents.h" 39 #include "content/public/browser/web_contents.h"
41 #include "content/public/browser/web_contents_delegate.h" 40 #include "content/public/browser/web_contents_delegate.h"
42 #include "ui/web_dialogs/constrained_web_dialog_ui.h" 41 #include "ui/web_dialogs/constrained_web_dialog_ui.h"
43 #include "ui/web_dialogs/web_dialog_delegate.h" 42 #include "ui/web_dialogs/web_dialog_delegate.h"
43 #include "ui/web_dialogs/web_dialog_web_contents_delegate.h"
44 #include "webkit/plugins/webplugininfo.h" 44 #include "webkit/plugins/webplugininfo.h"
45 45
46 using content::NativeWebKeyboardEvent; 46 using content::NativeWebKeyboardEvent;
47 using content::NavigationController; 47 using content::NavigationController;
48 using content::WebContents; 48 using content::WebContents;
49 using content::WebUIMessageHandler; 49 using content::WebUIMessageHandler;
50 using ui::ConstrainedWebDialogDelegate; 50 using ui::ConstrainedWebDialogDelegate;
51 using ui::WebDialogDelegate; 51 using ui::WebDialogDelegate;
52 using ui::WebDialogWebContentsDelegate;
52 53
53 namespace { 54 namespace {
54 55
55 void EnableInternalPDFPluginForTab(TabContents* preview_tab) { 56 void EnableInternalPDFPluginForTab(TabContents* preview_tab) {
56 // Always enable the internal PDF plugin for the print preview page. 57 // Always enable the internal PDF plugin for the print preview page.
57 ChromePluginServiceFilter::GetInstance()->OverridePluginForTab( 58 ChromePluginServiceFilter::GetInstance()->OverridePluginForTab(
58 preview_tab->web_contents()->GetRenderProcessHost()->GetID(), 59 preview_tab->web_contents()->GetRenderProcessHost()->GetID(),
59 preview_tab->web_contents()->GetRenderViewHost()->GetRoutingID(), 60 preview_tab->web_contents()->GetRenderViewHost()->GetRoutingID(),
60 GURL(), 61 GURL(),
61 ASCIIToUTF16(chrome::ChromeContentClient::kPDFPluginName)); 62 ASCIIToUTF16(chrome::ChromeContentClient::kPDFPluginName));
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>( 544 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(
544 preview_tab->web_contents()->GetWebUI()->GetController()); 545 preview_tab->web_contents()->GetWebUI()->GetController());
545 if (print_preview_ui) 546 if (print_preview_ui)
546 print_preview_ui->OnTabDestroyed(); 547 print_preview_ui->OnTabDestroyed();
547 548
548 preview_tab_map_.erase(preview_tab); 549 preview_tab_map_.erase(preview_tab);
549 RemoveObservers(preview_tab); 550 RemoveObservers(preview_tab);
550 } 551 }
551 552
552 } // namespace printing 553 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/constrained_web_dialog_delegate_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698