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

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

Issue 1102173002: Move GuestView layer in browser to components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test change to build 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 "components/guest_view/browser/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)
11 11
12 #if defined(ENABLE_PRINT_PREVIEW) 12 #if defined(ENABLE_PRINT_PREVIEW)
13 #include "chrome/browser/printing/print_view_manager.h" 13 #include "chrome/browser/printing/print_view_manager.h"
14 #else 14 #else
15 #include "chrome/browser/printing/print_view_manager_basic.h" 15 #include "chrome/browser/printing/print_view_manager_basic.h"
16 #endif // defined(ENABLE_PRINT_PREVIEW) 16 #endif // defined(ENABLE_PRINT_PREVIEW)
17 17
18 namespace printing { 18 namespace printing {
(...skipping 10 matching lines...) Expand all
29 return true; 29 return true;
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 guestview::GuestViewManager* guest_view_manager =
40 extensions::GuestViewManager::FromBrowserContext( 40 guestview::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