| OLD | NEW |
| 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/browser_frame.h" | 5 #include "chrome/browser/views/frame/browser_frame.h" |
| 6 | 6 |
| 7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
| 8 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 | 9 |
| 10 #include "chrome/browser/browser_list.h" | 10 #include "chrome/browser/browser_list.h" |
| 11 #include "chrome/browser/views/frame/browser_root_view.h" |
| 11 #include "chrome/browser/views/frame/browser_view.h" | 12 #include "chrome/browser/views/frame/browser_view.h" |
| 12 #include "chrome/browser/views/frame/glass_browser_frame_view.h" | 13 #include "chrome/browser/views/frame/glass_browser_frame_view.h" |
| 13 #include "chrome/browser/views/frame/opaque_browser_frame_view.h" | 14 #include "chrome/browser/views/frame/opaque_browser_frame_view.h" |
| 14 #include "chrome/common/resource_bundle.h" | 15 #include "chrome/common/resource_bundle.h" |
| 15 #include "chrome/common/win_util.h" | 16 #include "chrome/common/win_util.h" |
| 16 #include "chrome/views/window_delegate.h" | 17 #include "chrome/views/window_delegate.h" |
| 17 #include "grit/theme_resources.h" | 18 #include "grit/theme_resources.h" |
| 18 | 19 |
| 19 // static | 20 // static |
| 20 static const int kClientEdgeThickness = 3; | 21 static const int kClientEdgeThickness = 3; |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 else | 194 else |
| 194 browser_frame_view_ = new OpaqueBrowserFrameView(this, browser_view_); | 195 browser_frame_view_ = new OpaqueBrowserFrameView(this, browser_view_); |
| 195 return browser_frame_view_; | 196 return browser_frame_view_; |
| 196 } | 197 } |
| 197 | 198 |
| 198 void BrowserFrame::UpdateFrameAfterFrameChange() { | 199 void BrowserFrame::UpdateFrameAfterFrameChange() { |
| 199 Window::UpdateFrameAfterFrameChange(); | 200 Window::UpdateFrameAfterFrameChange(); |
| 200 UpdateDWMFrame(); | 201 UpdateDWMFrame(); |
| 201 } | 202 } |
| 202 | 203 |
| 204 |
| 205 views::RootView* BrowserFrame::CreateRootView() { |
| 206 return new BrowserRootView(this); |
| 207 } |
| 208 |
| 203 /////////////////////////////////////////////////////////////////////////////// | 209 /////////////////////////////////////////////////////////////////////////////// |
| 204 // BrowserFrame, private: | 210 // BrowserFrame, private: |
| 205 | 211 |
| 206 void BrowserFrame::UpdateDWMFrame() { | 212 void BrowserFrame::UpdateDWMFrame() { |
| 207 // Nothing to do yet. | 213 // Nothing to do yet. |
| 208 if (!client_view() || !browser_view_->IsBrowserTypeNormal()) | 214 if (!client_view() || !browser_view_->IsBrowserTypeNormal()) |
| 209 return; | 215 return; |
| 210 | 216 |
| 211 // In fullscreen mode, we don't extend glass into the client area at all, | 217 // In fullscreen mode, we don't extend glass into the client area at all, |
| 212 // because the GDI-drawn text in the web content composited over it will | 218 // because the GDI-drawn text in the web content composited over it will |
| 213 // become semi-transparent over any glass area. | 219 // become semi-transparent over any glass area. |
| 214 MARGINS margins = { 0 }; | 220 MARGINS margins = { 0 }; |
| 215 if (browser_view_->CanCurrentlyResize()) { | 221 if (browser_view_->CanCurrentlyResize()) { |
| 216 margins.cxLeftWidth = kClientEdgeThickness + 1; | 222 margins.cxLeftWidth = kClientEdgeThickness + 1; |
| 217 margins.cxRightWidth = kClientEdgeThickness + 1; | 223 margins.cxRightWidth = kClientEdgeThickness + 1; |
| 218 margins.cyBottomHeight = kClientEdgeThickness + 1; | 224 margins.cyBottomHeight = kClientEdgeThickness + 1; |
| 219 } | 225 } |
| 220 // In maximized mode, we only have a titlebar strip of glass, no side/bottom | 226 // In maximized mode, we only have a titlebar strip of glass, no side/bottom |
| 221 // borders. | 227 // borders. |
| 222 if (!browser_view_->IsFullscreen()) { | 228 if (!browser_view_->IsFullscreen()) { |
| 223 margins.cyTopHeight = | 229 margins.cyTopHeight = |
| 224 GetBoundsForTabStrip(browser_view_->tabstrip()).bottom(); | 230 GetBoundsForTabStrip(browser_view_->tabstrip()).bottom(); |
| 225 } | 231 } |
| 226 DwmExtendFrameIntoClientArea(GetHWND(), &margins); | 232 DwmExtendFrameIntoClientArea(GetHWND(), &margins); |
| 227 } | 233 } |
| OLD | NEW |