OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/chrome_views_delegate.h" | 5 #include "chrome/browser/ui/views/chrome_views_delegate.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 window->GetNativeWindowProperty(Profile::kProfileKey)); | 37 window->GetNativeWindowProperty(Profile::kProfileKey)); |
38 if (!profile) { | 38 if (!profile) { |
39 // Use local state for windows that have no explicit profile. | 39 // Use local state for windows that have no explicit profile. |
40 return g_browser_process->local_state(); | 40 return g_browser_process->local_state(); |
41 } | 41 } |
42 return profile->GetPrefs(); | 42 return profile->GetPrefs(); |
43 } | 43 } |
44 | 44 |
45 } // namespace | 45 } // namespace |
46 | 46 |
| 47 // static |
| 48 views::View* ChromeViewsDelegate::default_parent_view = NULL; |
| 49 |
47 /////////////////////////////////////////////////////////////////////////////// | 50 /////////////////////////////////////////////////////////////////////////////// |
48 // ChromeViewsDelegate, views::ViewsDelegate implementation: | 51 // ChromeViewsDelegate, views::ViewsDelegate implementation: |
49 | 52 |
50 ui::Clipboard* ChromeViewsDelegate::GetClipboard() const { | 53 ui::Clipboard* ChromeViewsDelegate::GetClipboard() const { |
51 return g_browser_process->clipboard(); | 54 return g_browser_process->clipboard(); |
52 } | 55 } |
53 | 56 |
54 views::View* ChromeViewsDelegate::GetDefaultParentView() { | 57 views::View* ChromeViewsDelegate::GetDefaultParentView() { |
55 return NULL; | 58 return default_parent_view; |
56 } | 59 } |
57 | 60 |
58 void ChromeViewsDelegate::SaveWindowPlacement(const views::Widget* window, | 61 void ChromeViewsDelegate::SaveWindowPlacement(const views::Widget* window, |
59 const std::wstring& window_name, | 62 const std::wstring& window_name, |
60 const gfx::Rect& bounds, | 63 const gfx::Rect& bounds, |
61 bool maximized) { | 64 bool maximized) { |
62 PrefService* prefs = GetPrefsForWindow(window); | 65 PrefService* prefs = GetPrefsForWindow(window); |
63 if (!prefs) | 66 if (!prefs) |
64 return; | 67 return; |
65 | 68 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 g_browser_process->AddRefModule(); | 148 g_browser_process->AddRefModule(); |
146 } | 149 } |
147 | 150 |
148 void ChromeViewsDelegate::ReleaseRef() { | 151 void ChromeViewsDelegate::ReleaseRef() { |
149 g_browser_process->ReleaseModule(); | 152 g_browser_process->ReleaseModule(); |
150 } | 153 } |
151 | 154 |
152 int ChromeViewsDelegate::GetDispositionForEvent(int event_flags) { | 155 int ChromeViewsDelegate::GetDispositionForEvent(int event_flags) { |
153 return event_utils::DispositionFromEventFlags(event_flags); | 156 return event_utils::DispositionFromEventFlags(event_flags); |
154 } | 157 } |
OLD | NEW |