Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Side by Side Diff: chrome/browser/ui/views/avatar_menu_button.cc

Issue 7834048: Preliminary work to allow Chrome to build with USE_AURA (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698