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 "base/command_line.h"
8 #include "ui/views/views_touch_selection_controller_factory.h"
12 ViewsDelegate::ViewsDelegate()
13 : views_tsc_factory_(new ViewsTouchEditingControllerFactory
) {
14 ui::TouchEditingControllerFactory::SetInstance(views_tsc_factory_
.get());
17 ViewsDelegate::~ViewsDelegate() {
18 ui::TouchEditingControllerFactory::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
) {
85 ui::ContextFactory
* ViewsDelegate::GetContextFactory() {
89 std::string
ViewsDelegate::GetApplicationName() {
90 base::FilePath program
= base::CommandLine::ForCurrentProcess()->GetProgram();
91 return program
.BaseName().AsUTF8Unsafe();
95 int ViewsDelegate::GetAppbarAutohideEdges(HMONITOR monitor
,
96 const base::Closure
& callback
) {