2014-07-03 08:44:58 +00:00
|
|
|
// Copyright (c) 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-CHROMIUM file.
|
|
|
|
|
|
|
|
#ifndef BRIGHTRAY_BROWSER_VIEWS_VIEWS_DELEGATE_H_
|
|
|
|
#define BRIGHTRAY_BROWSER_VIEWS_VIEWS_DELEGATE_H_
|
|
|
|
|
2017-05-18 22:06:57 +00:00
|
|
|
#include <string>
|
|
|
|
|
2014-07-03 08:44:58 +00:00
|
|
|
#include "base/compiler_specific.h"
|
|
|
|
#include "ui/views/views_delegate.h"
|
|
|
|
|
|
|
|
namespace brightray {
|
|
|
|
|
|
|
|
class ViewsDelegate : public views::ViewsDelegate {
|
|
|
|
public:
|
|
|
|
ViewsDelegate();
|
|
|
|
virtual ~ViewsDelegate();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// views::ViewsDelegate:
|
2015-06-05 04:07:27 +00:00
|
|
|
void SaveWindowPlacement(const views::Widget* window,
|
|
|
|
const std::string& window_name,
|
|
|
|
const gfx::Rect& bounds,
|
|
|
|
ui::WindowShowState show_state) override;
|
|
|
|
bool GetSavedWindowPlacement(
|
2014-07-03 08:44:58 +00:00
|
|
|
const views::Widget* widget,
|
|
|
|
const std::string& window_name,
|
|
|
|
gfx::Rect* bounds,
|
2014-10-23 03:10:39 +00:00
|
|
|
ui::WindowShowState* show_state) const override;
|
2015-06-05 04:07:27 +00:00
|
|
|
void NotifyAccessibilityEvent(
|
2014-10-23 03:10:39 +00:00
|
|
|
views::View* view, ui::AXEvent event_type) override;
|
2015-06-05 04:07:27 +00:00
|
|
|
void NotifyMenuItemFocused(const base::string16& menu_name,
|
|
|
|
const base::string16& menu_item_name,
|
|
|
|
int item_index,
|
|
|
|
int item_count,
|
|
|
|
bool has_submenu) override;
|
2014-07-03 08:44:58 +00:00
|
|
|
|
|
|
|
#if defined(OS_WIN)
|
2015-06-05 04:07:27 +00:00
|
|
|
HICON GetDefaultWindowIcon() const override;
|
|
|
|
HICON GetSmallWindowIcon() const override;
|
|
|
|
bool IsWindowInMetro(gfx::NativeWindow window) const override;
|
2014-07-03 08:44:58 +00:00
|
|
|
#elif defined(OS_LINUX) && !defined(OS_CHROMEOS)
|
2015-06-05 04:07:27 +00:00
|
|
|
gfx::ImageSkia* GetDefaultWindowIcon() const override;
|
2014-07-03 08:44:58 +00:00
|
|
|
#endif
|
2015-06-05 04:07:27 +00:00
|
|
|
views::NonClientFrameView* CreateDefaultNonClientFrameView(
|
2014-10-23 03:10:39 +00:00
|
|
|
views::Widget* widget) override;
|
2015-06-05 04:07:27 +00:00
|
|
|
void AddRef() override;
|
|
|
|
void ReleaseRef() override;
|
|
|
|
content::WebContents* CreateWebContents(
|
2014-07-03 08:44:58 +00:00
|
|
|
content::BrowserContext* browser_context,
|
2014-10-23 03:10:39 +00:00
|
|
|
content::SiteInstance* site_instance) override;
|
2015-06-05 04:07:27 +00:00
|
|
|
void OnBeforeWidgetInit(
|
2014-07-03 08:44:58 +00:00
|
|
|
views::Widget::InitParams* params,
|
2014-10-23 03:10:39 +00:00
|
|
|
views::internal::NativeWidgetDelegate* delegate) override;
|
2015-06-05 04:07:27 +00:00
|
|
|
bool WindowManagerProvidesTitleBar(bool maximized) override;
|
2014-07-03 08:44:58 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(ViewsDelegate);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace brightray
|
|
|
|
|
|
|
|
#endif // BRIGHTRAY_BROWSER_VIEWS_VIEWS_DELEGATE_H_
|