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

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 288493008: UMA Metrics for the user menu, including vasquette-detection (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nit - make a member variable const Created 6 years, 7 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 2362 matching lines...) Expand 10 before | Expand all | Expand 10 after
2373 } 2373 }
2374 2374
2375 void BrowserView::ShowAvatarBubbleFromAvatarButton(AvatarBubbleMode mode) { 2375 void BrowserView::ShowAvatarBubbleFromAvatarButton(AvatarBubbleMode mode) {
2376 if (switches::IsNewAvatarMenu()) { 2376 if (switches::IsNewAvatarMenu()) {
2377 NewAvatarButton* button = frame_->GetNewAvatarMenuButton(); 2377 NewAvatarButton* button = frame_->GetNewAvatarMenuButton();
2378 if (button) { 2378 if (button) {
2379 gfx::Point origin; 2379 gfx::Point origin;
2380 views::View::ConvertPointToScreen(button, &origin); 2380 views::View::ConvertPointToScreen(button, &origin);
2381 gfx::Rect bounds(origin, size()); 2381 gfx::Rect bounds(origin, size());
2382 2382
2383 ProfileChooserView::BubbleViewMode view_mode = 2383 ProfileChooserView::BubbleViewMode view_mode;
2384 (mode == BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT) ? 2384 switch (mode) {
2385 ProfileChooserView::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT : 2385 case BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT:
2386 ProfileChooserView::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; 2386 view_mode = ProfileChooserView::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT;
2387 break;
2388 case BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT_FROM_HEADER:
2389 view_mode =
2390 ProfileChooserView::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT_FROM_HEADER;
2391 break;
2392 case BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT:
2393 view_mode = ProfileChooserView::BUBBLE_VIEW_MODE_PROFILE_CHOOSER;
2394 }
2387 ProfileChooserView::ShowBubble( 2395 ProfileChooserView::ShowBubble(
2388 view_mode, button, views::BubbleBorder::TOP_RIGHT, 2396 view_mode, button, views::BubbleBorder::TOP_RIGHT,
2389 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, bounds, browser()); 2397 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, bounds, browser());
2390 } 2398 }
2391 } else { 2399 } else {
2392 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); 2400 AvatarMenuButton* button = frame_->GetAvatarMenuButton();
2393 if (button) 2401 if (button)
2394 button->ShowAvatarBubble(); 2402 button->ShowAvatarBubble();
2395 } 2403 }
2396 } 2404 }
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
2519 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { 2527 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) {
2520 gfx::Point icon_bottom( 2528 gfx::Point icon_bottom(
2521 toolbar_->location_bar()->GetLocationBarAnchorPoint()); 2529 toolbar_->location_bar()->GetLocationBarAnchorPoint());
2522 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); 2530 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom);
2523 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); 2531 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL));
2524 ConvertPointToTarget(infobar_container_, this, &infobar_top); 2532 ConvertPointToTarget(infobar_container_, this, &infobar_top);
2525 top_arrow_height = infobar_top.y() - icon_bottom.y(); 2533 top_arrow_height = infobar_top.y() - icon_bottom.y();
2526 } 2534 }
2527 return top_arrow_height; 2535 return top_arrow_height;
2528 } 2536 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698