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

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

Issue 42027: Make Chromium windows not hide auto-hide taskbars, take 2.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 9 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/views/frame/glass_browser_frame_view.h" 5 #include "chrome/browser/views/frame/glass_browser_frame_view.h"
6 6
7 #include "chrome/browser/views/frame/browser_view.h" 7 #include "chrome/browser/views/frame/browser_view.h"
8 #include "chrome/browser/views/tabs/tab_strip.h" 8 #include "chrome/browser/views/tabs/tab_strip.h"
9 #include "chrome/common/gfx/chrome_canvas.h" 9 #include "chrome/common/gfx/chrome_canvas.h"
10 #include "chrome/common/resource_bundle.h" 10 #include "chrome/common/resource_bundle.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 /////////////////////////////////////////////////////////////////////////////// 218 ///////////////////////////////////////////////////////////////////////////////
219 // GlassBrowserFrameView, views::View overrides: 219 // GlassBrowserFrameView, views::View overrides:
220 220
221 void GlassBrowserFrameView::Paint(ChromeCanvas* canvas) { 221 void GlassBrowserFrameView::Paint(ChromeCanvas* canvas) {
222 if (!browser_view_->IsTabStripVisible()) 222 if (!browser_view_->IsTabStripVisible())
223 return; // Nothing is visible, so don't bother to paint. 223 return; // Nothing is visible, so don't bother to paint.
224 224
225 PaintDistributorLogo(canvas); 225 PaintDistributorLogo(canvas);
226 PaintToolbarBackground(canvas); 226 PaintToolbarBackground(canvas);
227 PaintOTRAvatar(canvas); 227 PaintOTRAvatar(canvas);
228 PaintClientEdge(canvas); 228 if (!frame_->IsMaximized())
229 PaintRestoredClientEdge(canvas);
229 } 230 }
230 231
231 void GlassBrowserFrameView::Layout() { 232 void GlassBrowserFrameView::Layout() {
232 LayoutDistributorLogo(); 233 LayoutDistributorLogo();
233 LayoutOTRAvatar(); 234 LayoutOTRAvatar();
234 LayoutClientView(); 235 LayoutClientView();
235 } 236 }
236 237
237 /////////////////////////////////////////////////////////////////////////////// 238 ///////////////////////////////////////////////////////////////////////////////
238 // GlassBrowserFrameView, private: 239 // GlassBrowserFrameView, private:
239 240
240 int GlassBrowserFrameView::FrameBorderThickness() const { 241 int GlassBrowserFrameView::FrameBorderThickness() const {
241 return GetSystemMetrics(SM_CXSIZEFRAME); 242 return browser_view_->CanCurrentlyResize() ?
243 GetSystemMetrics(SM_CXSIZEFRAME) : 0;
242 } 244 }
243 245
244 int GlassBrowserFrameView::NonClientBorderThickness() const { 246 int GlassBrowserFrameView::NonClientBorderThickness() const {
245 return kNonClientBorderThickness; 247 return browser_view_->CanCurrentlyResize() ? kNonClientBorderThickness : 0;
246 } 248 }
247 249
248 int GlassBrowserFrameView::NonClientTopBorderHeight() const { 250 int GlassBrowserFrameView::NonClientTopBorderHeight() const {
249 return FrameBorderThickness() + 251 if (browser_view_->IsFullscreen())
250 (frame_->IsMaximized() ? 0 : kNonClientRestoredExtraThickness); 252 return 0;
253 // We'd like to use FrameBorderThickness() here, but the maximized Aero glass
254 // frame has a 0 frame border around most edges and a CXSIZEFRAME-thick border
255 // at the top (see AeroGlassFrame::OnGetMinMaxInfo()).
256 return GetSystemMetrics(SM_CXSIZEFRAME) +
257 (browser_view_->IsMaximized() ? 0 : kNonClientRestoredExtraThickness);
251 } 258 }
252 259
253 void GlassBrowserFrameView::PaintDistributorLogo(ChromeCanvas* canvas) { 260 void GlassBrowserFrameView::PaintDistributorLogo(ChromeCanvas* canvas) {
254 // The distributor logo is only painted when the frame is not maximized and 261 // The distributor logo is only painted when the frame is not maximized and
255 // when we actually have a logo. 262 // when we actually have a logo.
256 if (!frame_->IsMaximized() && distributor_logo_) { 263 if (!frame_->IsMaximized() && distributor_logo_) {
257 // NOTE: We don't mirror the logo placement here because the outer frame 264 // NOTE: We don't mirror the logo placement here because the outer frame
258 // itself isn't mirrored in RTL. This is a bug; if it is fixed, this should 265 // itself isn't mirrored in RTL. This is a bug; if it is fixed, this should
259 // be mirrored as in opaque_non_client_view.cc. 266 // be mirrored as in opaque_non_client_view.cc.
260 canvas->DrawBitmapInt(*distributor_logo_, logo_bounds_.x(), 267 canvas->DrawBitmapInt(*distributor_logo_, logo_bounds_.x(),
(...skipping 27 matching lines...) Expand all
288 return; 295 return;
289 296
290 SkBitmap otr_avatar_icon = browser_view_->GetOTRAvatarIcon(); 297 SkBitmap otr_avatar_icon = browser_view_->GetOTRAvatarIcon();
291 canvas->DrawBitmapInt(otr_avatar_icon, 0, 298 canvas->DrawBitmapInt(otr_avatar_icon, 0,
292 (otr_avatar_icon.height() - otr_avatar_bounds_.height()) / 2, 299 (otr_avatar_icon.height() - otr_avatar_bounds_.height()) / 2,
293 otr_avatar_bounds_.width(), otr_avatar_bounds_.height(), 300 otr_avatar_bounds_.width(), otr_avatar_bounds_.height(),
294 MirroredLeftPointForRect(otr_avatar_bounds_), otr_avatar_bounds_.y(), 301 MirroredLeftPointForRect(otr_avatar_bounds_), otr_avatar_bounds_.y(),
295 otr_avatar_bounds_.width(), otr_avatar_bounds_.height(), false); 302 otr_avatar_bounds_.width(), otr_avatar_bounds_.height(), false);
296 } 303 }
297 304
298 void GlassBrowserFrameView::PaintClientEdge(ChromeCanvas* canvas) { 305 void GlassBrowserFrameView::PaintRestoredClientEdge(ChromeCanvas* canvas) {
299 // The client edges start below the toolbar upper corner images regardless 306 // The client edges start below the toolbar upper corner images regardless
300 // of how tall the toolbar itself is. 307 // of how tall the toolbar itself is.
301 int client_area_top = 308 int client_area_top =
302 frame_->client_view()->y() + browser_view_->GetToolbarBounds().y() + 309 frame_->client_view()->y() + browser_view_->GetToolbarBounds().y() +
303 resources_->GetPartBitmap(FRAME_CLIENT_EDGE_TOP_LEFT)->height(); 310 resources_->GetPartBitmap(FRAME_CLIENT_EDGE_TOP_LEFT)->height();
304 311
305 gfx::Rect client_area_bounds = CalculateClientAreaBounds(width(), height()); 312 gfx::Rect client_area_bounds = CalculateClientAreaBounds(width(), height());
306 int client_area_bottom = 313 int client_area_bottom =
307 std::max(client_area_top, height() - NonClientBorderThickness()); 314 std::max(client_area_top, height() - NonClientBorderThickness());
308 int client_area_height = client_area_bottom - client_area_top; 315 int client_area_height = client_area_bottom - client_area_top;
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 422
416 #if defined(GOOGLE_CHROME_BUILD) 423 #if defined(GOOGLE_CHROME_BUILD)
417 distributor_logo_ = ResourceBundle::GetSharedInstance(). 424 distributor_logo_ = ResourceBundle::GetSharedInstance().
418 GetBitmapNamed(IDR_DISTRIBUTOR_LOGO); 425 GetBitmapNamed(IDR_DISTRIBUTOR_LOGO);
419 #endif 426 #endif
420 427
421 initialized = true; 428 initialized = true;
422 } 429 }
423 } 430 }
424 431
OLDNEW
« no previous file with comments | « chrome/browser/views/frame/glass_browser_frame_view.h ('k') | chrome/browser/views/frame/opaque_browser_frame_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698