Revert 268405 "Make sure that ScratchBuffer::Allocate() always r..."
[chromium-blink-merge.git] / ui / views / views_delegate.cc
blobbef6cdc730ed425069f1d68be7d3d1526c4328dc
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"
9 namespace views {
11 ViewsDelegate::ViewsDelegate()
12 : views_tsc_factory_(new ViewsTouchSelectionControllerFactory) {
13 ui::TouchSelectionControllerFactory::SetInstance(views_tsc_factory_.get());
16 ViewsDelegate::~ViewsDelegate() {
17 ui::TouchSelectionControllerFactory::SetInstance(NULL);
20 void ViewsDelegate::SaveWindowPlacement(const Widget* widget,
21 const std::string& window_name,
22 const gfx::Rect& bounds,
23 ui::WindowShowState show_state) {
26 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;
34 void ViewsDelegate::NotifyAccessibilityEvent(View* view,
35 ui::AXEvent event_type) {
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) {
45 #if defined(OS_WIN)
46 HICON ViewsDelegate::GetDefaultWindowIcon() const {
47 return NULL;
50 bool ViewsDelegate::IsWindowInMetro(gfx::NativeWindow window) const {
51 return false;
53 #elif defined(OS_LINUX) && !defined(OS_CHROMEOS)
54 gfx::ImageSkia* ViewsDelegate::GetDefaultWindowIcon() const {
55 return NULL;
57 #endif
59 NonClientFrameView* ViewsDelegate::CreateDefaultNonClientFrameView(
60 Widget* widget) {
61 return NULL;
64 void ViewsDelegate::AddRef() {
67 void ViewsDelegate::ReleaseRef() {
70 content::WebContents* ViewsDelegate::CreateWebContents(
71 content::BrowserContext* browser_context,
72 content::SiteInstance* site_instance) {
73 return NULL;
76 base::TimeDelta ViewsDelegate::GetDefaultTextfieldObscuredRevealDuration() {
77 return base::TimeDelta();
80 bool ViewsDelegate::WindowManagerProvidesTitleBar(bool maximized) {
81 return false;
84 #if defined(OS_WIN)
85 int ViewsDelegate::GetAppbarAutohideEdges(HMONITOR monitor,
86 const base::Closure& callback) {
87 return EDGE_BOTTOM;
89 #endif
91 } // namespace views