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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/printing/printing_ui_web_contents_observer.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/printing_ui_web_contents_observer.cc
diff --git a/chrome/browser/printing/printing_ui_web_contents_observer.cc b/chrome/browser/printing/printing_ui_web_contents_observer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..03a09f7009cb7f5e4f3f720e58fa5d0a665a0931
--- /dev/null
+++ b/chrome/browser/printing/printing_ui_web_contents_observer.cc
@@ -0,0 +1,20 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/printing/printing_ui_web_contents_observer.h"
+
+#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_contents_view.h"
+
+PrintingUIWebContentsObserver::PrintingUIWebContentsObserver(
+ content::WebContents* web_contents)
+ : content::WebContentsObserver(web_contents) {
+ DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+}
+
+gfx::NativeView PrintingUIWebContentsObserver::GetParentView() {
+ DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ return web_contents() ? web_contents()->GetView()->GetNativeView() : NULL;
+}
« no previous file with comments | « chrome/browser/printing/printing_ui_web_contents_observer.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698