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

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

Issue 1529703003: [EXPERIMENT] [MacViews] Enable and handle the profile switcher. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_mus.h" 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/extensions/extension_util.h" 10 #include "chrome/browser/extensions/extension_util.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 gfx::Rect BrowserNonClientFrameViewMus::GetWindowBoundsForClientBounds( 213 gfx::Rect BrowserNonClientFrameViewMus::GetWindowBoundsForClientBounds(
214 const gfx::Rect& client_bounds) const { 214 const gfx::Rect& client_bounds) const {
215 return client_bounds; 215 return client_bounds;
216 } 216 }
217 217
218 int BrowserNonClientFrameViewMus::NonClientHitTest(const gfx::Point& point) { 218 int BrowserNonClientFrameViewMus::NonClientHitTest(const gfx::Point& point) {
219 // TODO(sky): figure out how this interaction should work. 219 // TODO(sky): figure out how this interaction should work.
220 int hit_test = HTCLIENT; 220 int hit_test = HTCLIENT;
221 221
222 #if defined(FRAME_AVATAR_BUTTON) 222 #if defined(FRAME_AVATAR_BUTTON)
223 if (hit_test == HTCAPTION && profile_switcher_.view() && 223 if (profile_switcher_.HitTest(point))
224 ConvertedHitTest(this, profile_switcher_.view(), point)) {
225 return HTCLIENT; 224 return HTCLIENT;
226 }
227 #endif 225 #endif
228 226
229 // When the window is restored we want a large click target above the tabs 227 // When the window is restored we want a large click target above the tabs
230 // to drag the window, so redirect clicks in the tab's shadow to caption. 228 // to drag the window, so redirect clicks in the tab's shadow to caption.
231 if (hit_test == HTCLIENT && 229 if (hit_test == HTCLIENT &&
232 !(frame()->IsMaximized() || frame()->IsFullscreen())) { 230 !(frame()->IsMaximized() || frame()->IsFullscreen())) {
233 // Convert point to client coordinates. 231 // Convert point to client coordinates.
234 gfx::Point client_point(point); 232 gfx::Point client_point(point);
235 View::ConvertPointToTarget(this, frame()->client_view(), &client_point); 233 View::ConvertPointToTarget(this, frame()->client_view(), &client_point);
236 // Report hits in shadow at top of tabstrip as caption. 234 // Report hits in shadow at top of tabstrip as caption.
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 } 615 }
618 616
619 void BrowserNonClientFrameViewMus::PaintContentEdge(gfx::Canvas* canvas) { 617 void BrowserNonClientFrameViewMus::PaintContentEdge(gfx::Canvas* canvas) {
620 DCHECK(!UsePackagedAppHeaderStyle() && !UseWebAppHeaderStyle()); 618 DCHECK(!UsePackagedAppHeaderStyle() && !UseWebAppHeaderStyle());
621 const int bottom = frame_values().normal_insets.bottom(); 619 const int bottom = frame_values().normal_insets.bottom();
622 canvas->FillRect( 620 canvas->FillRect(
623 gfx::Rect(0, bottom, width(), kClientEdgeThickness), 621 gfx::Rect(0, bottom, width(), kClientEdgeThickness),
624 GetThemeProvider()->GetColor( 622 GetThemeProvider()->GetColor(
625 ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR)); 623 ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR));
626 } 624 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698