| Index: chrome/browser/ui/views/athena/athena_util.cc
|
| diff --git a/chrome/browser/ui/views/athena/athena_util.cc b/chrome/browser/ui/views/athena/athena_util.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..145524e327aacb7afa34c96450617bac98d78b7e
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/views/athena/athena_util.cc
|
| @@ -0,0 +1,22 @@
|
| +// Copyright 2014 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/ui/views/athena/athena_util.h"
|
| +
|
| +#include "athena/activity/public/activity.h"
|
| +#include "athena/activity/public/activity_manager.h"
|
| +#include "athena/wm/public/window_list_provider.h"
|
| +#include "athena/wm/public/window_manager.h"
|
| +
|
| +content::WebContents* GetWebContentsForWindow(aura::Window* owner_window) {
|
| + if (!owner_window) {
|
| + athena::WindowListProvider* window_list =
|
| + athena::WindowManager::Get()->GetWindowListProvider();
|
| + DCHECK(window_list->GetWindowList().size());
|
| + owner_window = window_list->GetWindowList().back();
|
| + }
|
| + athena::Activity* activity =
|
| + athena::ActivityManager::Get()->GetActivityForWindow(owner_window);
|
| + return activity->GetWebContents();
|
| +}
|
|
|