| 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..508305a9c9e05b9e482430a9f9e72775ec788535
|
| --- /dev/null
|
| +++ b/chrome/browser/printing/printing_ui_web_contents_observer.cc
|
| @@ -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.
|
| +
|
| +#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));
|
| +}
|
| +
|
| +bool PrintingUIWebContentsObserver::GetParentView(
|
| + gfx::NativeView* parent_view) {
|
| + DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
|
| +
|
| + if (!web_contents())
|
| + return false;
|
| +
|
| + *parent_view = web_contents()->GetView()->GetNativeView();
|
| + return true;
|
| +}
|
|
|