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

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

Issue 2775083002: Update conditional in BrowserNonClientFrameView::DoesIntersectRect. (Closed)
Patch Set: edit comments Created 3 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/browser_non_client_frame_view_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/browser_non_client_frame_view.h" 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "chrome/app/vector_icons/vector_icons.h" 8 #include "chrome/app/vector_icons/vector_icons.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/profiles/avatar_menu.h" 10 #include "chrome/browser/profiles/avatar_menu.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 // Otherwise, claim |rect| only if it is above the bottom of the tabstrip in 202 // Otherwise, claim |rect| only if it is above the bottom of the tabstrip in
203 // a non-tab portion. 203 // a non-tab portion.
204 TabStrip* tabstrip = browser_view()->tabstrip(); 204 TabStrip* tabstrip = browser_view()->tabstrip();
205 if (!tabstrip || !browser_view()->IsTabStripVisible()) 205 if (!tabstrip || !browser_view()->IsTabStripVisible())
206 return false; 206 return false;
207 207
208 gfx::RectF rect_in_tabstrip_coords_f(rect); 208 gfx::RectF rect_in_tabstrip_coords_f(rect);
209 View::ConvertRectToTarget(this, tabstrip, &rect_in_tabstrip_coords_f); 209 View::ConvertRectToTarget(this, tabstrip, &rect_in_tabstrip_coords_f);
210 gfx::Rect rect_in_tabstrip_coords = 210 gfx::Rect rect_in_tabstrip_coords =
211 gfx::ToEnclosingRect(rect_in_tabstrip_coords_f); 211 gfx::ToEnclosingRect(rect_in_tabstrip_coords_f);
212 if (rect_in_tabstrip_coords.bottom() > tabstrip->GetLocalBounds().bottom()) { 212 if (rect_in_tabstrip_coords.y() >= tabstrip->GetLocalBounds().bottom()) {
213 // |rect| is below the tabstrip. 213 // |rect| is below the tabstrip.
214 return false; 214 return false;
215 } 215 }
216 216
217 if (tabstrip->HitTestRect(rect_in_tabstrip_coords)) { 217 if (tabstrip->HitTestRect(rect_in_tabstrip_coords)) {
218 // Claim |rect| if it is in a non-tab portion of the tabstrip. 218 // Claim |rect| if it is in a non-tab portion of the tabstrip.
219 return tabstrip->IsRectInWindowCaption(rect_in_tabstrip_coords); 219 return tabstrip->IsRectInWindowCaption(rect_in_tabstrip_coords);
220 } 220 }
221 221
222 // We claim |rect| because it is above the bottom of the tabstrip, but 222 // We claim |rect| because it is above the bottom of the tabstrip, but
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 // safety. See crbug.com/313800. 271 // safety. See crbug.com/313800.
272 gfx::Image decoration; 272 gfx::Image decoration;
273 AvatarMenu::GetImageForMenuButton( 273 AvatarMenu::GetImageForMenuButton(
274 browser_view()->browser()->profile()->GetPath(), &decoration); 274 browser_view()->browser()->profile()->GetPath(), &decoration);
275 // This can happen if the user deletes the current profile. 275 // This can happen if the user deletes the current profile.
276 if (decoration.IsEmpty()) 276 if (decoration.IsEmpty())
277 return; 277 return;
278 chrome::DrawTaskbarDecoration(frame_->GetNativeWindow(), &decoration); 278 chrome::DrawTaskbarDecoration(frame_->GetNativeWindow(), &decoration);
279 #endif 279 #endif
280 } 280 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/browser_non_client_frame_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698