OLD | NEW |
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 Loading... |
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 | |
347 gfx::Rect OpaqueBrowserFrameView::GetWindowBoundsForClientBounds( | 339 gfx::Rect OpaqueBrowserFrameView::GetWindowBoundsForClientBounds( |
348 const gfx::Rect& client_bounds) const { | 340 const gfx::Rect& client_bounds) const { |
349 int top_height = NonClientTopBorderHeight(false, false); | 341 int top_height = NonClientTopBorderHeight(false, false); |
350 int border_thickness = NonClientBorderThickness(); | 342 int border_thickness = NonClientBorderThickness(); |
351 return gfx::Rect(std::max(0, client_bounds.x() - border_thickness), | 343 return gfx::Rect(std::max(0, client_bounds.x() - border_thickness), |
352 std::max(0, client_bounds.y() - top_height), | 344 std::max(0, client_bounds.y() - top_height), |
353 client_bounds.width() + (2 * border_thickness), | 345 client_bounds.width() + (2 * border_thickness), |
354 client_bounds.height() + top_height + border_thickness); | 346 client_bounds.height() + top_height + border_thickness); |
355 } | 347 } |
356 | 348 |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1235 std::max(0, width - (2 * border_thickness)), | 1227 std::max(0, width - (2 * border_thickness)), |
1236 std::max(0, height - GetReservedHeight() - | 1228 std::max(0, height - GetReservedHeight() - |
1237 top_height - border_thickness)); | 1229 top_height - border_thickness)); |
1238 } | 1230 } |
1239 | 1231 |
1240 void OpaqueBrowserFrameView::RegisterLoginNotifications() { | 1232 void OpaqueBrowserFrameView::RegisterLoginNotifications() { |
1241 PrefService* pref_service = browser_view_->browser()->profile()->GetPrefs(); | 1233 PrefService* pref_service = browser_view_->browser()->profile()->GetPrefs(); |
1242 DCHECK(pref_service); | 1234 DCHECK(pref_service); |
1243 username_pref_.Init(prefs::kGoogleServicesUsername, pref_service, this); | 1235 username_pref_.Init(prefs::kGoogleServicesUsername, pref_service, this); |
1244 } | 1236 } |
OLD | NEW |