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

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

Issue 27451002: Printing: Keep track of WebContents lifetime for the native printing UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/printing/printing_ui_web_contents_observer.h"
6
7 #include "content/public/browser/browser_thread.h"
8 #include "content/public/browser/web_contents.h"
9 #include "content/public/browser/web_contents_view.h"
10
11 PrintingUIWebContentsObserver::PrintingUIWebContentsObserver(
12 content::WebContents* web_contents)
13 : content::WebContentsObserver(web_contents) {
14 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
15 }
16
17 bool PrintingUIWebContentsObserver::GetParentView(
18 gfx::NativeView* parent_view) {
19 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
20
21 if (!web_contents())
22 return false;
23
24 *parent_view = web_contents()->GetView()->GetNativeView();
25 return true;
26 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698