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.
4
5 #include "ui/views/views_delegate.h"
6
7 #include "ui/views/views_touch_selection_controller_factory.h"
8
9 namespace views {
10
ViewsDelegate()11 ViewsDelegate::ViewsDelegate()
12 : views_tsc_factory_(new ViewsTouchSelectionControllerFactory) {
13 ui::TouchSelectionControllerFactory::SetInstance(views_tsc_factory_.get());
14 }
15
~ViewsDelegate()16 ViewsDelegate::~ViewsDelegate() {
17 ui::TouchSelectionControllerFactory::SetInstance(NULL);
18 }
19
SaveWindowPlacement(const Widget * widget,const std::string & window_name,const gfx::Rect & bounds,ui::WindowShowState show_state)20 void ViewsDelegate::SaveWindowPlacement(const Widget* widget,
21 const std::string& window_name,
22 const gfx::Rect& bounds,
23 ui::WindowShowState show_state) {
24 }
25
GetSavedWindowPlacement(const Widget * widget,const std::string & window_name,gfx::Rect * bounds,ui::WindowShowState * show_state) const26 bool ViewsDelegate::GetSavedWindowPlacement(
27 const Widget* widget,
28 const std::string& window_name,
29 gfx::Rect* bounds,
30 ui::WindowShowState* show_state) const {
31 return false;
32 }
33
NotifyAccessibilityEvent(View * view,ui::AXEvent event_type)34 void ViewsDelegate::NotifyAccessibilityEvent(View* view,
35 ui::AXEvent event_type) {
36 }
37
NotifyMenuItemFocused(const base::string16 & menu_name,const base::string16 & menu_item_name,int item_index,int item_count,bool has_submenu)38 void ViewsDelegate::NotifyMenuItemFocused(const base::string16& menu_name,
39 const base::string16& menu_item_name,
40 int item_index,
41 int item_count,
42 bool has_submenu) {
43 }
44
45 #if defined(OS_WIN)
GetDefaultWindowIcon() const46 HICON ViewsDelegate::GetDefaultWindowIcon() const {
47 return NULL;
48 }
49
IsWindowInMetro(gfx::NativeWindow window) const50 bool ViewsDelegate::IsWindowInMetro(gfx::NativeWindow window) const {
51 return false;
52 }
53 #elif defined(OS_LINUX) && !defined(OS_CHROMEOS)
GetDefaultWindowIcon() const54 gfx::ImageSkia* ViewsDelegate::GetDefaultWindowIcon() const {
55 return NULL;
56 }
57 #endif
58
CreateDefaultNonClientFrameView(Widget * widget)59 NonClientFrameView* ViewsDelegate::CreateDefaultNonClientFrameView(
60 Widget* widget) {
61 return NULL;
62 }
63
AddRef()64 void ViewsDelegate::AddRef() {
65 }
66
ReleaseRef()67 void ViewsDelegate::ReleaseRef() {
68 }
69
CreateWebContents(content::BrowserContext * browser_context,content::SiteInstance * site_instance)70 content::WebContents* ViewsDelegate::CreateWebContents(
71 content::BrowserContext* browser_context,
72 content::SiteInstance* site_instance) {
73 return NULL;
74 }
75
GetDefaultTextfieldObscuredRevealDuration()76 base::TimeDelta ViewsDelegate::GetDefaultTextfieldObscuredRevealDuration() {
77 return base::TimeDelta();
78 }
79
WindowManagerProvidesTitleBar(bool maximized)80 bool ViewsDelegate::WindowManagerProvidesTitleBar(bool maximized) {
81 return false;
82 }
83
84 #if defined(USE_AURA)
GetContextFactory()85 ui::ContextFactory* ViewsDelegate::GetContextFactory() {
86 return NULL;
87 }
88 #endif
89
90 #if defined(OS_WIN)
GetAppbarAutohideEdges(HMONITOR monitor,const base::Closure & callback)91 int ViewsDelegate::GetAppbarAutohideEdges(HMONITOR monitor,
92 const base::Closure& callback) {
93 return EDGE_BOTTOM;
94 }
95 #endif
96
97 } // namespace views
98