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

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

Issue 1066563006: GuestView: Move GuestViewManager extension dependencies to ExtensionsGuestViewManagerDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@extensions_guest_view_message_filter
Patch Set: Fixed NavigateGuest Created 5 years, 8 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_view_manager_common.h" 5 #include "chrome/browser/printing/print_view_manager_common.h"
6 6
7 #if defined(ENABLE_EXTENSIONS) 7 #if defined(ENABLE_EXTENSIONS)
8 #include "extensions/browser/guest_view/guest_view_manager.h" 8 #include "extensions/browser/guest_view/guest_view_manager.h"
9 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_gues t.h" 9 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_gues t.h"
10 #endif // defined(ENABLE_EXTENSIONS) 10 #endif // defined(ENABLE_EXTENSIONS)
(...skipping 19 matching lines...) Expand all
30 } 30 }
31 return false; 31 return false;
32 } 32 }
33 #endif // defined(ENABLE_EXTENSIONS) 33 #endif // defined(ENABLE_EXTENSIONS)
34 34
35 // If we have a single full-page embedded mime handler view guest, print the 35 // If we have a single full-page embedded mime handler view guest, print the
36 // guest's WebContents instead. 36 // guest's WebContents instead.
37 content::WebContents* GetWebContentsToUse(content::WebContents* contents) { 37 content::WebContents* GetWebContentsToUse(content::WebContents* contents) {
38 #if defined(ENABLE_EXTENSIONS) 38 #if defined(ENABLE_EXTENSIONS)
39 extensions::GuestViewManager* guest_view_manager = 39 extensions::GuestViewManager* guest_view_manager =
40 extensions::GuestViewManager::FromBrowserContextIfAvailable( 40 extensions::GuestViewManager::FromBrowserContext(
41 contents->GetBrowserContext()); 41 contents->GetBrowserContext());
42 if (guest_view_manager) { 42 if (guest_view_manager) {
43 guest_view_manager->ForEachGuest( 43 guest_view_manager->ForEachGuest(
44 contents, 44 contents,
45 base::Bind(&StoreFullPagePlugin, &contents)); 45 base::Bind(&StoreFullPagePlugin, &contents));
46 } 46 }
47 #endif // defined(ENABLE_EXTENSIONS) 47 #endif // defined(ENABLE_EXTENSIONS)
48 return contents; 48 return contents;
49 } 49 }
50 50
(...skipping 30 matching lines...) Expand all
81 PrintViewManager* print_view_manager = 81 PrintViewManager* print_view_manager =
82 PrintViewManager::FromWebContents(GetWebContentsToUse(contents)); 82 PrintViewManager::FromWebContents(GetWebContentsToUse(contents));
83 if (!print_view_manager) 83 if (!print_view_manager)
84 return; 84 return;
85 print_view_manager->BasicPrint(); 85 print_view_manager->BasicPrint();
86 #endif // ENABLE_PRINT_PREVIEW 86 #endif // ENABLE_PRINT_PREVIEW
87 } 87 }
88 #endif // ENABLE_BASIC_PRINTING 88 #endif // ENABLE_BASIC_PRINTING
89 89
90 } // namespace printing 90 } // namespace printing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698