#include "base/command_line.h"
#include "chrome/browser/profiles/profiles_state.h"
-#include "chrome/browser/ui/views/avatar_label.h"
-#include "chrome/browser/ui/views/avatar_menu_button.h"
+#include "chrome/browser/ui/views/profiles/avatar_label.h"
+#include "chrome/browser/ui/views/profiles/avatar_menu_button.h"
#include "chrome/common/chrome_switches.h"
-#include "chrome/common/profile_management_switches.h"
+#include "components/signin/core/common/profile_management_switches.h"
#include "ui/gfx/font.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/controls/label.h"
-#if defined(OS_WIN)
-#include "win8/util/win8_util.h"
-#endif // OS_WIN
-
namespace {
// Besides the frame border, there's another 9 px of empty space atop the
OpaqueBrowserFrameViewLayout::~OpaqueBrowserFrameViewLayout() {}
-// static
-bool OpaqueBrowserFrameViewLayout::ShouldAddDefaultCaptionButtons() {
-#if defined(OS_WIN)
- return !win8::IsSingleWindowMetroMode();
-#else
- return true;
-#endif
-}
-
void OpaqueBrowserFrameViewLayout::SetButtonOrdering(
const std::vector<views::FrameButton>& leading_buttons,
const std::vector<views::FrameButton>& trailing_buttons) {
available_width -= trailing_button_start_;
available_width -= leading_button_start_;
- if (delegate_->GetAdditionalReservedSpaceInTabStrip())
- available_width -= delegate_->GetAdditionalReservedSpaceInTabStrip();
-
const int caption_spacing = NewTabCaptionSpacing();
const int tabstrip_width = available_width - caption_spacing;
gfx::Rect bounds(leading_button_start_, GetTabStripInsetsTop(false),
}
void OpaqueBrowserFrameViewLayout::LayoutWindowControls(views::View* host) {
- if (!ShouldAddDefaultCaptionButtons())
- return;
-
int caption_y = CaptionButtonY(false);
// Keep a list of all buttons that we don't show.
}
void OpaqueBrowserFrameViewLayout::LayoutNewStyleAvatar(views::View* host) {
- DCHECK(switches::IsNewProfileManagement());
+ DCHECK(switches::IsNewAvatarMenu());
if (!new_avatar_button_)
return;
int button_x = host->width() - trailing_button_start_ -
button_size_with_offset;
int button_y = CaptionButtonY(false);
+ // If the window is maximized, the button is 1 pixel too short. Determined
+ // via visual inspection.
+ int extra_height = IsTitleBarCondensed() ? 1 : 0;
trailing_button_start_ += button_size_with_offset;
minimum_size_for_buttons_ += button_size_with_offset;
button_x,
button_y,
label_size.width(),
- button_y + kCaptionButtonHeightWithPadding);
+ button_y + kCaptionButtonHeightWithPadding + extra_height);
}
void OpaqueBrowserFrameViewLayout::LayoutAvatar(views::View* host) {
// on the trailing side.
leading_button_start_++;
- if (delegate_->IsRegularOrGuestSession() &&
- switches::IsNewProfileManagement())
+ if (delegate_->IsRegularOrGuestSession() && switches::IsNewAvatarMenu())
LayoutNewStyleAvatar(host);
else
LayoutAvatar(host);