1 // Copyright (c) 2013 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.
5 #include "ui/views/views_delegate.h"
7 #include "ui/views/views_touch_selection_controller_factory.h"
11 ViewsDelegate::ViewsDelegate()
12 : views_tsc_factory_(new ViewsTouchSelectionControllerFactory),
13 should_show_titlebar_(true) {
14 ui::TouchSelectionControllerFactory::SetInstance(views_tsc_factory_.get());
17 ViewsDelegate::~ViewsDelegate() {
18 ui::TouchSelectionControllerFactory::SetInstance(NULL);
21 void ViewsDelegate::SaveWindowPlacement(const Widget* widget,
22 const std::string& window_name,
23 const gfx::Rect& bounds,
24 ui::WindowShowState show_state) {
27 bool ViewsDelegate::GetSavedWindowPlacement(
29 const std::string& window_name,
31 ui::WindowShowState* show_state) const {
35 void ViewsDelegate::NotifyAccessibilityEvent(View* view,
36 ui::AXEvent event_type) {
39 void ViewsDelegate::NotifyMenuItemFocused(const base::string16& menu_name,
40 const base::string16& menu_item_name,
47 HICON ViewsDelegate::GetDefaultWindowIcon() const {
51 bool ViewsDelegate::IsWindowInMetro(gfx::NativeWindow window) const {
54 #elif defined(OS_LINUX) && !defined(OS_CHROMEOS)
55 gfx::ImageSkia* ViewsDelegate::GetDefaultWindowIcon() const {
60 NonClientFrameView* ViewsDelegate::CreateDefaultNonClientFrameView(
65 void ViewsDelegate::AddRef() {
68 void ViewsDelegate::ReleaseRef() {
71 content::WebContents* ViewsDelegate::CreateWebContents(
72 content::BrowserContext* browser_context,
73 content::SiteInstance* site_instance) {
77 base::TimeDelta ViewsDelegate::GetDefaultTextfieldObscuredRevealDuration() {
78 return base::TimeDelta();
81 bool ViewsDelegate::WindowManagerProvidesTitleBar(bool maximized) {
86 ui::ContextFactory* ViewsDelegate::GetContextFactory() {
92 int ViewsDelegate::GetAppbarAutohideEdges(HMONITOR monitor,
93 const base::Closure& callback) {
98 void ViewsDelegate::SetShouldShowTitleBar(bool show_title_bar) {
99 should_show_titlebar_ = show_title_bar;
102 bool ViewsDelegate::ShouldShowTitleBar() const {
103 return should_show_titlebar_;