| 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/opaque_browser_frame_view.h" | 5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 frame()->Close(); | 328 frame()->Close(); |
| 329 } else if (sender == new_avatar_button()) { | 329 } else if (sender == new_avatar_button()) { |
| 330 DCHECK(event.IsMouseEvent()); | 330 DCHECK(event.IsMouseEvent()); |
| 331 bool isRightClick = | 331 bool isRightClick = |
| 332 static_cast<const ui::MouseEvent&>(event).IsRightMouseButton(); | 332 static_cast<const ui::MouseEvent&>(event).IsRightMouseButton(); |
| 333 | 333 |
| 334 BrowserWindow::AvatarBubbleMode mode = isRightClick ? | 334 BrowserWindow::AvatarBubbleMode mode = isRightClick ? |
| 335 BrowserWindow::AVATAR_BUBBLE_MODE_FAST_USER_SWITCH : | 335 BrowserWindow::AVATAR_BUBBLE_MODE_FAST_USER_SWITCH : |
| 336 BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT; | 336 BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT; |
| 337 | 337 |
| 338 if (switches::IsFastUserSwitching() || !isRightClick) { | 338 browser_view()->ShowAvatarBubbleFromAvatarButton( |
| 339 browser_view()->ShowAvatarBubbleFromAvatarButton( | 339 mode, |
| 340 mode, | 340 signin::ManageAccountsParams()); |
| 341 signin::ManageAccountsParams()); | |
| 342 } | |
| 343 } | 341 } |
| 344 } | 342 } |
| 345 | 343 |
| 346 void OpaqueBrowserFrameView::OnMenuButtonClicked(views::View* source, | 344 void OpaqueBrowserFrameView::OnMenuButtonClicked(views::View* source, |
| 347 const gfx::Point& point) { | 345 const gfx::Point& point) { |
| 348 #if defined(OS_LINUX) | 346 #if defined(OS_LINUX) |
| 349 views::MenuRunner menu_runner(frame()->GetSystemMenuModel(), | 347 views::MenuRunner menu_runner(frame()->GetSystemMenuModel(), |
| 350 views::MenuRunner::HAS_MNEMONICS); | 348 views::MenuRunner::HAS_MNEMONICS); |
| 351 ignore_result(menu_runner.RunMenuAt(browser_view()->GetWidget(), | 349 ignore_result(menu_runner.RunMenuAt(browser_view()->GetWidget(), |
| 352 window_icon_, | 350 window_icon_, |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 932 | 930 |
| 933 int OpaqueBrowserFrameView::GetTopAreaHeight() const { | 931 int OpaqueBrowserFrameView::GetTopAreaHeight() const { |
| 934 gfx::ImageSkia* frame_image = GetFrameImage(); | 932 gfx::ImageSkia* frame_image = GetFrameImage(); |
| 935 int top_area_height = frame_image->height(); | 933 int top_area_height = frame_image->height(); |
| 936 if (browser_view()->IsTabStripVisible()) { | 934 if (browser_view()->IsTabStripVisible()) { |
| 937 top_area_height = std::max(top_area_height, | 935 top_area_height = std::max(top_area_height, |
| 938 GetBoundsForTabStrip(browser_view()->tabstrip()).bottom()); | 936 GetBoundsForTabStrip(browser_view()->tabstrip()).bottom()); |
| 939 } | 937 } |
| 940 return top_area_height; | 938 return top_area_height; |
| 941 } | 939 } |
| OLD | NEW |