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

Unified Diff: chrome/browser/printing/printing_ui_web_contents_observer.h

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
Index: chrome/browser/printing/printing_ui_web_contents_observer.h
diff --git a/chrome/browser/printing/printing_ui_web_contents_observer.h b/chrome/browser/printing/printing_ui_web_contents_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..578cf4c85cea76f5e8080f764197d8fc604878a1
--- /dev/null
+++ b/chrome/browser/printing/printing_ui_web_contents_observer.h
@@ -0,0 +1,26 @@
+// 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.
+
+#ifndef CHROME_BROWSER_PRINTING_PRINTING_UI_WEB_CONTENTS_OBSERVER_H_
+#define CHROME_BROWSER_PRINTING_PRINTING_UI_WEB_CONTENTS_OBSERVER_H_
+
+#include "base/basictypes.h"
+#include "content/public/browser/web_contents_observer.h"
+#include "ui/gfx/native_widget_types.h"
+
+// Wrapper used to keep track of the lifetime of a WebContents.
+// Lives on the UI thread.
+class PrintingUIWebContentsObserver : public content::WebContentsObserver {
+ public:
+ explicit PrintingUIWebContentsObserver(content::WebContents* web_contents);
+
+ // If the observed WebContents is valid, return true and put its parent
+ // NativeView in |parent_view|.
+ bool GetParentView(gfx::NativeView* parent_view);
Vitaly Buka (NO REVIEWS) 2013/10/16 05:14:24 Why not just return gfx::NativeView*
Lei Zhang 2013/10/16 19:20:37 Hmm, gfx::NativeView is a foo* on most platforms,
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PrintingUIWebContentsObserver);
+};
+
+#endif // CHROME_BROWSER_PRINTING_PRINTING_UI_WEB_CONTENTS_OBSERVER_H_
« no previous file with comments | « chrome/browser/printing/printing_message_filter.cc ('k') | chrome/browser/printing/printing_ui_web_contents_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698