// Copyright (c) 2011 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/frame/browser_non_client_frame_view.h"

#include "chrome/browser/ui/touch/frame/touch_browser_frame_view.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/popup_non_client_frame_view.h"

namespace browser {

BrowserNonClientFrameView* CreateBrowserNonClientFrameView(
    BrowserFrame* frame, BrowserView* browser_view) {
  if (browser_view->IsBrowserTypePopup() ||
      browser_view->IsBrowserTypePanel()) {
    // TODO(anicolao): implement popups for touch
    NOTIMPLEMENTED();
    return new PopupNonClientFrameView(frame);
  } else {
    return new TouchBrowserFrameView(frame, browser_view);
  }
}

}  // browser

// Copyright (c) 2011 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/frame/browser_non_client_frame_view.h"

#include "chrome/browser/ui/touch/frame/touch_browser_frame_view.h"
#include "chrome/browser/ui/views/frame/browser_view.h"

namespace browser {

BrowserNonClientFrameView* CreateBrowserNonClientFrameView(
    BrowserFrame* frame, BrowserView* browser_view) {
  if (browser_view->IsBrowserTypePopup() ||
      browser_view->IsBrowserTypePanel()) {
    // TODO(anicolao): implement popups for touch
    NOTIMPLEMENTED();
    return NULL;
  } else {
    return new TouchBrowserFrameView(frame, browser_view);
  }
}

}  // browser

--- 
+++ 
@@ -6,6 +6,7 @@
 
 #include "chrome/browser/ui/touch/frame/touch_browser_frame_view.h"
 #include "chrome/browser/ui/views/frame/browser_view.h"
+#include "chrome/browser/ui/views/frame/popup_non_client_frame_view.h"
 
 namespace browser {
 
@@ -15,7 +16,7 @@
       browser_view->IsBrowserTypePanel()) {
     // TODO(anicolao): implement popups for touch
     NOTIMPLEMENTED();
-    return NULL;
+    return new PopupNonClientFrameView(frame);
   } else {
     return new TouchBrowserFrameView(frame, browser_view);
   }
Use the non-touch popup frame instead of NULL.

While this change isn't really all that usable in chrome itself, it fixes a
number of the tests in browser_tests and ui_tests, and fixes a crash in some
other tests to unmask other failures.

BUG=none
TEST=some failing tests (e.g. BrowserNavigatorTest.*) should pass on the touch buildbot.

Review URL: http://codereview.chromium.org/7064035

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@86530 0039d316-1c4b-4281-b951-d872f2087c98
