Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / ui / views / chrome_views_delegate.h
blobd4d197f127122bb8efab8ac832dbf9f31c3934ec
1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_VIEWS_CHROME_VIEWS_DELEGATE_H_
6 #define CHROME_BROWSER_UI_VIEWS_CHROME_VIEWS_DELEGATE_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "build/build_config.h"
11 #include "ui/accessibility/ax_enums.h"
12 #include "ui/views/views_delegate.h"
14 class ChromeViewsDelegate : public views::ViewsDelegate {
15 public:
16 ChromeViewsDelegate();
17 ~ChromeViewsDelegate() override;
19 // views::ViewsDelegate:
20 void SaveWindowPlacement(const views::Widget* window,
21 const std::string& window_name,
22 const gfx::Rect& bounds,
23 ui::WindowShowState show_state) override;
24 bool GetSavedWindowPlacement(const views::Widget* widget,
25 const std::string& window_name,
26 gfx::Rect* bounds,
27 ui::WindowShowState* show_state) const override;
28 void NotifyAccessibilityEvent(views::View* view,
29 ui::AXEvent event_type) override;
30 #if defined(OS_WIN)
31 virtual HICON GetDefaultWindowIcon() const override;
32 virtual HICON GetSmallWindowIcon() const override;
33 virtual bool IsWindowInMetro(gfx::NativeWindow window) const override;
34 #elif defined(OS_LINUX) && !defined(OS_CHROMEOS)
35 gfx::ImageSkia* GetDefaultWindowIcon() const override;
36 #endif
38 #if defined(USE_ASH)
39 views::NonClientFrameView* CreateDefaultNonClientFrameView(
40 views::Widget* widget) override;
41 #endif
42 void AddRef() override;
43 void ReleaseRef() override;
44 void OnBeforeWidgetInit(
45 views::Widget::InitParams* params,
46 views::internal::NativeWidgetDelegate* delegate) override;
47 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
48 bool WindowManagerProvidesTitleBar(bool maximized) override;
49 #endif
50 ui::ContextFactory* GetContextFactory() override;
51 std::string GetApplicationName() override;
52 #if defined(OS_WIN)
53 virtual int GetAppbarAutohideEdges(HMONITOR monitor,
54 const base::Closure& callback) override;
55 #endif
57 private:
58 #if defined(OS_WIN)
59 typedef std::map<HMONITOR, int> AppbarAutohideEdgeMap;
61 // Callback on main thread with the edges. |returned_edges| is the value that
62 // was returned from the call to GetAutohideEdges() that initiated the lookup.
63 void OnGotAppbarAutohideEdges(const base::Closure& callback,
64 HMONITOR monitor,
65 int returned_edges,
66 int edges);
67 #endif
69 // Function to retrieve default opacity value mainly based on platform
70 // and desktop context.
71 views::Widget::InitParams::WindowOpacity GetOpacityForInitParams(
72 const views::Widget::InitParams& params);
74 #if defined(OS_WIN)
75 AppbarAutohideEdgeMap appbar_autohide_edge_map_;
76 // If true we're in the process of notifying a callback from
77 // GetAutohideEdges().start a new query.
78 bool in_autohide_edges_callback_;
80 base::WeakPtrFactory<ChromeViewsDelegate> weak_factory_;
81 #endif
83 DISALLOW_COPY_AND_ASSIGN(ChromeViewsDelegate);
86 #endif // CHROME_BROWSER_UI_VIEWS_CHROME_VIEWS_DELEGATE_H_