Commit 63d1d611 authored by pkotwicz@chromium.org's avatar pkotwicz@chromium.org

Always use the native frame for popups and hosted apps on desktop linux.

Previously, OpaqueBrowserFrameView was being used for popups and hosted apps. So popups and hosted apps would only use the native frame when the "Use system titlebars and borders" option was selected.

BUG=376137
TEST=Manual, see bug (Must use i3 window manager)

Review URL: https://codereview.chromium.org/327083003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278392 0039d316-1c4b-4281-b951-d872f2087c98
parent 013befe6
......@@ -184,7 +184,8 @@ views::View* BrowserFrame::GetFrameView() const {
}
bool BrowserFrame::UseCustomFrame() const {
return use_custom_frame_pref_.GetValue();
return use_custom_frame_pref_.GetValue() &&
browser_view_->IsBrowserTypeNormal();
}
bool BrowserFrame::ShouldSaveWindowPlacement() const {
......
// Copyright (c) 2012 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 "base/command_line.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h"
#include "chrome/browser/ui/views/frame/popup_non_client_frame_view.h"
#include "chrome/common/chrome_switches.h"
namespace chrome {
BrowserNonClientFrameView* CreateBrowserNonClientFrameView(
BrowserFrame* frame, BrowserView* browser_view) {
Browser::Type type = browser_view->browser()->type();
switch (type) {
case Browser::TYPE_POPUP:
return new PopupNonClientFrameView(frame);
default:
return new OpaqueBrowserFrameView(frame, browser_view);
}
}
} // namespace chrome
// Copyright (c) 2012 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/popup_non_client_frame_view.h"
#include "chrome/browser/ui/views/frame/browser_frame.h"
#include "ui/base/hit_test.h"
#include "ui/gfx/point.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/size.h"
PopupNonClientFrameView::PopupNonClientFrameView(BrowserFrame* frame)
: BrowserNonClientFrameView(frame, NULL) {
frame->set_frame_type(views::Widget::FRAME_TYPE_FORCE_NATIVE);
}
gfx::Rect PopupNonClientFrameView::GetBoundsForClientView() const {
return gfx::Rect(0, 0, width(), height());
}
gfx::Rect PopupNonClientFrameView::GetWindowBoundsForClientBounds(
const gfx::Rect& client_bounds) const {
return client_bounds;
}
int PopupNonClientFrameView::NonClientHitTest(const gfx::Point& point) {
return bounds().Contains(point) ? HTCLIENT : HTNOWHERE;
}
void PopupNonClientFrameView::GetWindowMask(const gfx::Size& size,
gfx::Path* window_mask) {
}
void PopupNonClientFrameView::ResetWindowControls() {
}
void PopupNonClientFrameView::UpdateWindowIcon() {
}
void PopupNonClientFrameView::UpdateWindowTitle() {
}
gfx::Rect PopupNonClientFrameView::GetBoundsForTabStrip(
views::View* tabstrip) const {
return gfx::Rect(0, 0, width(), tabstrip->GetPreferredSize().height());
}
int PopupNonClientFrameView::GetTopInset() const {
return 0;
}
int PopupNonClientFrameView::GetThemeBackgroundXInset() const {
return 0;
}
void PopupNonClientFrameView::UpdateThrobber(bool running) {
}
// Copyright (c) 2012 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_UI_VIEWS_FRAME_POPUP_NON_CLIENT_FRAME_VIEW_H_
#define CHROME_BROWSER_UI_VIEWS_FRAME_POPUP_NON_CLIENT_FRAME_VIEW_H_
#include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h"
// BrowserNonClientFrameView implementation for popups. We let the window
// manager implementation render the decorations for popups, so this draws
// nothing.
class PopupNonClientFrameView : public BrowserNonClientFrameView {
public:
explicit PopupNonClientFrameView(BrowserFrame* frame);
// NonClientFrameView:
virtual gfx::Rect GetBoundsForClientView() const OVERRIDE;
virtual gfx::Rect GetWindowBoundsForClientBounds(
const gfx::Rect& client_bounds) const OVERRIDE;
virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE;
virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask)
OVERRIDE;
virtual void ResetWindowControls() OVERRIDE;
virtual void UpdateWindowIcon() OVERRIDE;
virtual void UpdateWindowTitle() OVERRIDE;
// BrowserNonClientFrameView:
virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const OVERRIDE;
virtual int GetTopInset() const OVERRIDE;
virtual int GetThemeBackgroundXInset() const OVERRIDE;
virtual void UpdateThrobber(bool running) OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(PopupNonClientFrameView);
};
#endif // CHROME_BROWSER_UI_VIEWS_FRAME_POPUP_NON_CLIENT_FRAME_VIEW_H_
......@@ -1656,7 +1656,6 @@
'browser/ui/views/frame/browser_non_client_frame_view_ash.h',
'browser/ui/views/frame/browser_non_client_frame_view_ash.cc',
'browser/ui/views/frame/browser_non_client_frame_view_factory_aura.cc',
'browser/ui/views/frame/browser_non_client_frame_view_factory_x11.cc',
'browser/ui/views/frame/browser_root_view.cc',
'browser/ui/views/frame/browser_root_view.h',
'browser/ui/views/frame/browser_shutdown.cc',
......@@ -1712,8 +1711,6 @@
'browser/ui/views/frame/opaque_browser_frame_view_platform_specific.cc',
'browser/ui/views/frame/opaque_browser_frame_view_linux.h',
'browser/ui/views/frame/opaque_browser_frame_view_linux.cc',
'browser/ui/views/frame/popup_non_client_frame_view.cc',
'browser/ui/views/frame/popup_non_client_frame_view.h',
'browser/ui/views/frame/scroll_end_effect_controller.h',
'browser/ui/views/frame/scroll_end_effect_controller_ash.cc',
'browser/ui/views/frame/scroll_end_effect_controller_ash.h',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment