| 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_win.h" | 5 #include "chrome/browser/views/frame/browser_frame_win.h" |
| 6 | 6 |
| 7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
| 8 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 | 9 |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 } | 62 } |
| 63 | 63 |
| 64 BrowserFrameWin::~BrowserFrameWin() { | 64 BrowserFrameWin::~BrowserFrameWin() { |
| 65 } | 65 } |
| 66 | 66 |
| 67 views::Window* BrowserFrameWin::GetWindow() { | 67 views::Window* BrowserFrameWin::GetWindow() { |
| 68 return this; | 68 return this; |
| 69 } | 69 } |
| 70 | 70 |
| 71 void BrowserFrameWin::TabStripCreated(TabStripWrapper* tabstrip) { | 71 void BrowserFrameWin::TabStripCreated(TabStripWrapper* tabstrip) { |
| 72 root_view_->set_tabstrip(tabstrip); | |
| 73 } | 72 } |
| 74 | 73 |
| 75 int BrowserFrameWin::GetMinimizeButtonOffset() const { | 74 int BrowserFrameWin::GetMinimizeButtonOffset() const { |
| 76 TITLEBARINFOEX titlebar_info; | 75 TITLEBARINFOEX titlebar_info; |
| 77 titlebar_info.cbSize = sizeof(TITLEBARINFOEX); | 76 titlebar_info.cbSize = sizeof(TITLEBARINFOEX); |
| 78 SendMessage(GetNativeView(), WM_GETTITLEBARINFOEX, 0, (WPARAM)&titlebar_info); | 77 SendMessage(GetNativeView(), WM_GETTITLEBARINFOEX, 0, (WPARAM)&titlebar_info); |
| 79 | 78 |
| 80 CPoint minimize_button_corner(titlebar_info.rgrect[2].left, | 79 CPoint minimize_button_corner(titlebar_info.rgrect[2].left, |
| 81 titlebar_info.rgrect[2].top); | 80 titlebar_info.rgrect[2].top); |
| 82 MapWindowPoints(HWND_DESKTOP, GetNativeView(), &minimize_button_corner, 1); | 81 MapWindowPoints(HWND_DESKTOP, GetNativeView(), &minimize_button_corner, 1); |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 browser_frame_view_ = new OpaqueBrowserFrameView(this, browser_view_); | 311 browser_frame_view_ = new OpaqueBrowserFrameView(this, browser_view_); |
| 313 return browser_frame_view_; | 312 return browser_frame_view_; |
| 314 } | 313 } |
| 315 | 314 |
| 316 void BrowserFrameWin::UpdateFrameAfterFrameChange() { | 315 void BrowserFrameWin::UpdateFrameAfterFrameChange() { |
| 317 WindowWin::UpdateFrameAfterFrameChange(); | 316 WindowWin::UpdateFrameAfterFrameChange(); |
| 318 UpdateDWMFrame(); | 317 UpdateDWMFrame(); |
| 319 } | 318 } |
| 320 | 319 |
| 321 views::RootView* BrowserFrameWin::CreateRootView() { | 320 views::RootView* BrowserFrameWin::CreateRootView() { |
| 322 root_view_ = new BrowserRootView(this); | 321 root_view_ = new BrowserRootView(browser_view_, this); |
| 323 return root_view_; | 322 return root_view_; |
| 324 } | 323 } |
| 325 | 324 |
| 326 /////////////////////////////////////////////////////////////////////////////// | 325 /////////////////////////////////////////////////////////////////////////////// |
| 327 // BrowserFrame, private: | 326 // BrowserFrame, private: |
| 328 | 327 |
| 329 void BrowserFrameWin::UpdateDWMFrame() { | 328 void BrowserFrameWin::UpdateDWMFrame() { |
| 330 // Nothing to do yet. | 329 // Nothing to do yet. |
| 331 if (!GetClientView() || !browser_view_->IsBrowserTypeNormal() || | 330 if (!GetClientView() || !browser_view_->IsBrowserTypeNormal() || |
| 332 !win_util::ShouldUseVistaFrame()) | 331 !win_util::ShouldUseVistaFrame()) |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 // more "transparent" look. | 369 // more "transparent" look. |
| 371 ::SetWindowLong(frame_hwnd, GWL_STYLE, | 370 ::SetWindowLong(frame_hwnd, GWL_STYLE, |
| 372 saved_window_style_ & ~WS_CAPTION); | 371 saved_window_style_ & ~WS_CAPTION); |
| 373 SetLayeredWindowAttributes(frame_hwnd, RGB(0xFF, 0xFF, 0xFF), | 372 SetLayeredWindowAttributes(frame_hwnd, RGB(0xFF, 0xFF, 0xFF), |
| 374 kTabDragWindowAlpha, LWA_ALPHA); | 373 kTabDragWindowAlpha, LWA_ALPHA); |
| 375 } else { | 374 } else { |
| 376 ::SetWindowLong(frame_hwnd, GWL_STYLE, saved_window_style_); | 375 ::SetWindowLong(frame_hwnd, GWL_STYLE, saved_window_style_); |
| 377 ::SetWindowLong(frame_hwnd, GWL_EXSTYLE, saved_window_ex_style_); | 376 ::SetWindowLong(frame_hwnd, GWL_EXSTYLE, saved_window_ex_style_); |
| 378 } | 377 } |
| 379 } | 378 } |
| OLD | NEW |