OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/frame/browser_non_client_frame_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/profiles/avatar_menu.h" | 9 #include "chrome/browser/profiles/avatar_menu.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/profiles/profile_info_cache.h" | 11 #include "chrome/browser/profiles/profile_info_cache.h" |
12 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
13 #include "chrome/browser/profiles/profiles_state.h" | 13 #include "chrome/browser/profiles/profiles_state.h" |
14 #include "chrome/browser/ui/view_ids.h" | 14 #include "chrome/browser/ui/view_ids.h" |
15 #include "chrome/browser/ui/views/avatar_label.h" | 15 #include "chrome/browser/ui/views/avatar_label.h" |
16 #include "chrome/browser/ui/views/avatar_menu_button.h" | 16 #include "chrome/browser/ui/views/avatar_menu_button.h" |
17 #include "chrome/browser/ui/views/frame/browser_view.h" | 17 #include "chrome/browser/ui/views/frame/browser_view.h" |
18 #include "chrome/browser/ui/views/frame/taskbar_decorator.h" | 18 #include "chrome/browser/ui/views/frame/taskbar_decorator.h" |
19 #include "chrome/browser/ui/views/new_avatar_button.h" | 19 #include "chrome/browser/ui/views/new_avatar_button.h" |
20 #include "chrome/browser/ui/views/profile_chooser_view.h" | |
21 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
22 #include "grit/generated_resources.h" | 21 #include "grit/generated_resources.h" |
23 #include "grit/theme_resources.h" | 22 #include "grit/theme_resources.h" |
24 #include "third_party/skia/include/core/SkColor.h" | 23 #include "third_party/skia/include/core/SkColor.h" |
25 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
26 #include "ui/base/resource/resource_bundle.h" | 25 #include "ui/base/resource/resource_bundle.h" |
27 #include "ui/base/theme_provider.h" | 26 #include "ui/base/theme_provider.h" |
28 #include "ui/gfx/image/image.h" | 27 #include "ui/gfx/image/image.h" |
29 #include "ui/views/background.h" | 28 #include "ui/views/background.h" |
30 | 29 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 new_avatar_button_->set_id(VIEW_ID_NEW_AVATAR_BUTTON); | 142 new_avatar_button_->set_id(VIEW_ID_NEW_AVATAR_BUTTON); |
144 AddChildView(new_avatar_button_); | 143 AddChildView(new_avatar_button_); |
145 frame_->GetRootView()->Layout(); | 144 frame_->GetRootView()->Layout(); |
146 } | 145 } |
147 } else if (new_avatar_button_) { | 146 } else if (new_avatar_button_) { |
148 delete new_avatar_button_; | 147 delete new_avatar_button_; |
149 new_avatar_button_ = NULL; | 148 new_avatar_button_ = NULL; |
150 frame_->GetRootView()->Layout(); | 149 frame_->GetRootView()->Layout(); |
151 } | 150 } |
152 } | 151 } |
153 | |
154 void BrowserNonClientFrameView::ShowProfileChooserViewBubble() { | |
155 gfx::Point origin; | |
156 views::View::ConvertPointToScreen(new_avatar_button(), &origin); | |
157 gfx::Rect bounds(origin, size()); | |
158 | |
159 ProfileChooserView::ShowBubble( | |
160 new_avatar_button(), views::BubbleBorder::TOP_RIGHT, | |
161 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, bounds, | |
162 browser_view_->browser()); | |
163 } | |
OLD | NEW |