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

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

Issue 598163002: [Win] Redesign the new avatar button. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
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/glass_browser_frame_view.h" 5 #include "chrome/browser/ui/views/frame/glass_browser_frame_view.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/app/chrome_dll_resource.h" 10 #include "chrome/app/chrome_dll_resource.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 gfx::Rect GlassBrowserFrameView::GetBoundsForTabStrip( 106 gfx::Rect GlassBrowserFrameView::GetBoundsForTabStrip(
107 views::View* tabstrip) const { 107 views::View* tabstrip) const {
108 int minimize_button_offset = 108 int minimize_button_offset =
109 std::min(frame()->GetMinimizeButtonOffset(), width()); 109 std::min(frame()->GetMinimizeButtonOffset(), width());
110 110
111 // The new avatar button is optionally displayed to the left of the 111 // The new avatar button is optionally displayed to the left of the
112 // minimize button. 112 // minimize button.
113 if (new_avatar_button()) { 113 if (new_avatar_button()) {
114 DCHECK(switches::IsNewAvatarMenu()); 114 DCHECK(switches::IsNewAvatarMenu());
115 minimize_button_offset -= new_avatar_button()->width(); 115 minimize_button_offset -=
sky 2014/09/24 23:21:39 I'm confused here. Shouldn't you only adjust the b
noms (inactive) 2014/09/25 14:06:18 The new tab button fits under it, but not the tabs
116 new_avatar_button()->width() + kNewAvatarButtonOffset;
117
118 // In non-maximized mode, allow the new tab button to completely slide under
119 // the avatar button.
120 if (!frame()->IsMaximized() && !base::i18n::IsRTL()) {
121 minimize_button_offset +=
122 TabStrip::kNewTabButtonAssetWidth + kNewTabCaptionRestoredSpacing;
123 }
116 } 124 }
117 125
118 int tabstrip_x = browser_view()->ShouldShowAvatar() ? 126 int tabstrip_x = browser_view()->ShouldShowAvatar() ?
119 (avatar_bounds_.right() + kAvatarRightSpacing) : 127 (avatar_bounds_.right() + kAvatarRightSpacing) :
120 NonClientBorderThickness() + kTabStripIndent; 128 NonClientBorderThickness() + kTabStripIndent;
121 // In RTL languages, we have moved an avatar icon left by the size of window 129 // In RTL languages, we have moved an avatar icon left by the size of window
122 // controls to prevent it from being rendered over them. So, we use its x 130 // controls to prevent it from being rendered over them. So, we use its x
123 // position to move this tab strip left when maximized. Also, we can render 131 // position to move this tab strip left when maximized. Also, we can render
124 // a tab strip until the left end of this window without considering the size 132 // a tab strip until the left end of this window without considering the size
125 // of window controls in RTL languages. 133 // of window controls in RTL languages.
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 static bool initialized = false; 595 static bool initialized = false;
588 if (!initialized) { 596 if (!initialized) {
589 for (int i = 0; i < kThrobberIconCount; ++i) { 597 for (int i = 0; i < kThrobberIconCount; ++i) {
590 throbber_icons_[i] = 598 throbber_icons_[i] =
591 ui::LoadThemeIconFromResourcesDataDLL(IDI_THROBBER_01 + i); 599 ui::LoadThemeIconFromResourcesDataDLL(IDI_THROBBER_01 + i);
592 DCHECK(throbber_icons_[i]); 600 DCHECK(throbber_icons_[i]);
593 } 601 }
594 initialized = true; 602 initialized = true;
595 } 603 }
596 } 604 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698