athena_chrome_app_window_client.cc revision 1320f92c476a1ad9d19dba2a48c72b75566198e9
1// Copyright 2014 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 "athena/extensions/chrome/athena_chrome_app_window_client.h"
6
7#include "athena/extensions/chrome/athena_chrome_app_delegate.h"
8#include "chrome/browser/devtools/devtools_window.h"
9#include "chrome/common/extensions/features/feature_channel.h"
10#include "extensions/browser/app_window/app_window.h"
11
12namespace athena {
13
14AthenaChromeAppWindowClient::AthenaChromeAppWindowClient() {
15}
16
17AthenaChromeAppWindowClient::~AthenaChromeAppWindowClient() {
18}
19
20extensions::AppWindow* AthenaChromeAppWindowClient::CreateAppWindow(
21    content::BrowserContext* context,
22    const extensions::Extension* extension) {
23  return new extensions::AppWindow(
24      context, new AthenaChromeAppDelegate, extension);
25}
26
27void AthenaChromeAppWindowClient::OpenDevToolsWindow(
28    content::WebContents* web_contents,
29    const base::Closure& callback) {
30  // TODO(oshima): Figure out what to do.
31  DevToolsWindow* devtools_window = DevToolsWindow::OpenDevToolsWindow(
32      web_contents, DevToolsToggleAction::ShowConsole());
33  devtools_window->SetLoadCompletedCallback(callback);
34}
35
36bool AthenaChromeAppWindowClient::IsCurrentChannelOlderThanDev() {
37  return extensions::GetCurrentChannel() > chrome::VersionInfo::CHANNEL_DEV;
38}
39
40}  // namespace athena
41