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/avatar_menu_button.h" | 5 #include "chrome/browser/ui/views/avatar_menu_button.h" |
6 | 6 |
7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
8 #include "chrome/browser/ui/profile_menu_model.h" | 8 #include "chrome/browser/ui/profile_menu_model.h" |
9 #include "chrome/browser/ui/views/avatar_menu_bubble_view.h" | 9 #include "chrome/browser/ui/views/avatar_menu_bubble_view.h" |
10 #include "chrome/browser/ui/views/frame/browser_view.h" | 10 #include "chrome/browser/ui/views/frame/browser_view.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 return static_cast<int>(x + 0.5); | 24 return static_cast<int>(x + 0.5); |
25 } | 25 } |
26 | 26 |
27 // The Windows 7 taskbar supports dynamic overlays and effects, we use this | 27 // The Windows 7 taskbar supports dynamic overlays and effects, we use this |
28 // to ovelay the avatar icon there. The overlay only applies if the taskbar | 28 // to ovelay the avatar icon there. The overlay only applies if the taskbar |
29 // is in "default large icon mode". This function is a best effort deal so | 29 // is in "default large icon mode". This function is a best effort deal so |
30 // we bail out silently at any error condition. | 30 // we bail out silently at any error condition. |
31 // See http://msdn.microsoft.com/en-us/library/dd391696(VS.85).aspx for | 31 // See http://msdn.microsoft.com/en-us/library/dd391696(VS.85).aspx for |
32 // more information. | 32 // more information. |
33 void DrawTaskBarDecoration(const Browser* browser, const SkBitmap* bitmap) { | 33 void DrawTaskBarDecoration(const Browser* browser, const SkBitmap* bitmap) { |
34 #if defined(OS_WIN) | 34 #if defined(OS_WIN) && !defined(USE_AURA) |
35 if (base::win::GetVersion() < base::win::VERSION_WIN7) | 35 if (base::win::GetVersion() < base::win::VERSION_WIN7) |
36 return; | 36 return; |
37 BrowserWindow* bw = browser->window(); | 37 BrowserWindow* bw = browser->window(); |
38 if (!bw) | 38 if (!bw) |
39 return; | 39 return; |
40 gfx::NativeWindow window = bw->GetNativeHandle(); | 40 gfx::NativeWindow window = bw->GetNativeHandle(); |
41 if (!window) | 41 if (!window) |
42 return; | 42 return; |
43 | 43 |
44 base::win::ScopedComPtr<ITaskbarList3> taskbar; | 44 base::win::ScopedComPtr<ITaskbarList3> taskbar; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 views::View::ConvertPointToScreen(this, &origin); | 138 views::View::ConvertPointToScreen(this, &origin); |
139 gfx::Rect bounds(0, 0, width(), height()); | 139 gfx::Rect bounds(0, 0, width(), height()); |
140 bounds.set_origin(origin); | 140 bounds.set_origin(origin); |
141 | 141 |
142 AvatarMenuBubbleView* bubble_view = new AvatarMenuBubbleView(browser_); | 142 AvatarMenuBubbleView* bubble_view = new AvatarMenuBubbleView(browser_); |
143 // Bubble::Show() takes ownership of the view. | 143 // Bubble::Show() takes ownership of the view. |
144 Bubble::Show(browser_view->GetWidget(), bounds, | 144 Bubble::Show(browser_view->GetWidget(), bounds, |
145 views::BubbleBorder::TOP_LEFT, | 145 views::BubbleBorder::TOP_LEFT, |
146 bubble_view, bubble_view); | 146 bubble_view, bubble_view); |
147 } | 147 } |
OLD | NEW |