This source file includes following definitions.
- browser_desktop_window_tree_host_
- OnHostClosed
- InitNativeWidget
- AsNativeWidget
- AsNativeWidget
- UsesNativeSystemMenu
- GetMinimizeButtonOffset
#include "chrome/browser/ui/views/frame/desktop_browser_frame_aura.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/ui/views/frame/browser_desktop_window_tree_host.h"
#include "chrome/browser/ui/views/frame/browser_shutdown.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_observer.h"
#include "ui/base/hit_test.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/simple_menu_model.h"
#include "ui/gfx/font.h"
#include "ui/views/view.h"
#include "ui/wm/core/visibility_controller.h"
using aura::Window;
DesktopBrowserFrameAura::DesktopBrowserFrameAura(
BrowserFrame* browser_frame,
BrowserView* browser_view)
: views::DesktopNativeWidgetAura(browser_frame),
browser_view_(browser_view),
browser_frame_(browser_frame),
browser_desktop_window_tree_host_(NULL) {
GetNativeWindow()->SetName("BrowserFrameAura");
}
DesktopBrowserFrameAura::~DesktopBrowserFrameAura() {
}
void DesktopBrowserFrameAura::OnHostClosed() {
DestroyBrowserWebContents(browser_view_->browser());
aura::client::SetVisibilityClient(GetNativeView()->GetRootWindow(), NULL);
DesktopNativeWidgetAura::OnHostClosed();
}
void DesktopBrowserFrameAura::InitNativeWidget(
const views::Widget::InitParams& params) {
browser_desktop_window_tree_host_ =
BrowserDesktopWindowTreeHost::CreateBrowserDesktopWindowTreeHost(
browser_frame_,
this,
browser_view_,
browser_frame_);
views::Widget::InitParams modified_params = params;
modified_params.desktop_window_tree_host =
browser_desktop_window_tree_host_->AsDesktopWindowTreeHost();
DesktopNativeWidgetAura::InitNativeWidget(modified_params);
visibility_controller_.reset(new wm::VisibilityController);
aura::client::SetVisibilityClient(GetNativeView()->GetRootWindow(),
visibility_controller_.get());
wm::SetChildWindowVisibilityChangesAnimated(
GetNativeView()->GetRootWindow());
}
views::NativeWidget* DesktopBrowserFrameAura::AsNativeWidget() {
return this;
}
const views::NativeWidget* DesktopBrowserFrameAura::AsNativeWidget() const {
return this;
}
bool DesktopBrowserFrameAura::UsesNativeSystemMenu() const {
return browser_desktop_window_tree_host_->UsesNativeSystemMenu();
}
int DesktopBrowserFrameAura::GetMinimizeButtonOffset() const {
return browser_desktop_window_tree_host_->GetMinimizeButtonOffset();
}