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

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

Issue 6975037: Revert 85666 - Consolidate ShouldUseNativeFrame/AlwaysUseNativeFrame/UseNativeFrame spaghetti. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/opaque_browser_frame_view.h" 5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/prefs/pref_service.h" 10 #include "chrome/browser/prefs/pref_service.h"
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 return min_size; 329 return min_size;
330 } 330 }
331 331
332 /////////////////////////////////////////////////////////////////////////////// 332 ///////////////////////////////////////////////////////////////////////////////
333 // OpaqueBrowserFrameView, views::NonClientFrameView implementation: 333 // OpaqueBrowserFrameView, views::NonClientFrameView implementation:
334 334
335 gfx::Rect OpaqueBrowserFrameView::GetBoundsForClientView() const { 335 gfx::Rect OpaqueBrowserFrameView::GetBoundsForClientView() const {
336 return client_view_bounds_; 336 return client_view_bounds_;
337 } 337 }
338 338
339 bool OpaqueBrowserFrameView::AlwaysUseNativeFrame() const {
340 return frame_->AlwaysUseNativeFrame();
341 }
342
343 bool OpaqueBrowserFrameView::AlwaysUseCustomFrame() const {
344 return true;
345 }
346
339 gfx::Rect OpaqueBrowserFrameView::GetWindowBoundsForClientBounds( 347 gfx::Rect OpaqueBrowserFrameView::GetWindowBoundsForClientBounds(
340 const gfx::Rect& client_bounds) const { 348 const gfx::Rect& client_bounds) const {
341 int top_height = NonClientTopBorderHeight(false, false); 349 int top_height = NonClientTopBorderHeight(false, false);
342 int border_thickness = NonClientBorderThickness(); 350 int border_thickness = NonClientBorderThickness();
343 return gfx::Rect(std::max(0, client_bounds.x() - border_thickness), 351 return gfx::Rect(std::max(0, client_bounds.x() - border_thickness),
344 std::max(0, client_bounds.y() - top_height), 352 std::max(0, client_bounds.y() - top_height),
345 client_bounds.width() + (2 * border_thickness), 353 client_bounds.width() + (2 * border_thickness),
346 client_bounds.height() + top_height + border_thickness); 354 client_bounds.height() + top_height + border_thickness);
347 } 355 }
348 356
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after
1227 std::max(0, width - (2 * border_thickness)), 1235 std::max(0, width - (2 * border_thickness)),
1228 std::max(0, height - GetReservedHeight() - 1236 std::max(0, height - GetReservedHeight() -
1229 top_height - border_thickness)); 1237 top_height - border_thickness));
1230 } 1238 }
1231 1239
1232 void OpaqueBrowserFrameView::RegisterLoginNotifications() { 1240 void OpaqueBrowserFrameView::RegisterLoginNotifications() {
1233 PrefService* pref_service = browser_view_->browser()->profile()->GetPrefs(); 1241 PrefService* pref_service = browser_view_->browser()->profile()->GetPrefs();
1234 DCHECK(pref_service); 1242 DCHECK(pref_service);
1235 username_pref_.Init(prefs::kGoogleServicesUsername, pref_service, this); 1243 username_pref_.Init(prefs::kGoogleServicesUsername, pref_service, this);
1236 } 1244 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/opaque_browser_frame_view.h ('k') | chrome/browser/ui/views/frame/popup_non_client_frame_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698