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