| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 saved_window_ex_style_(0), | 44 saved_window_ex_style_(0), |
| 45 detached_drag_mode_(false), | 45 detached_drag_mode_(false), |
| 46 drop_tabstrip_(NULL), | 46 drop_tabstrip_(NULL), |
| 47 root_view_(NULL), | 47 root_view_(NULL), |
| 48 frame_initialized_(false), | 48 frame_initialized_(false), |
| 49 profile_(profile) { | 49 profile_(profile) { |
| 50 browser_view_->set_frame(this); | 50 browser_view_->set_frame(this); |
| 51 GetNonClientView()->SetFrameView(CreateFrameViewForWindow()); | 51 GetNonClientView()->SetFrameView(CreateFrameViewForWindow()); |
| 52 // Don't focus anything on creation, selecting a tab will set the focus. | 52 // Don't focus anything on creation, selecting a tab will set the focus. |
| 53 set_focus_on_creation(false); | 53 set_focus_on_creation(false); |
| 54 // Force popups and apps under Vista to have a nonthemed frame. |
| 55 if (win_util::ShouldUseVistaFrame() && |
| 56 !browser_view_->IsBrowserTypeNormal()) |
| 57 GetNonClientView()->ForceAeroGlassFrame(); |
| 54 } | 58 } |
| 55 | 59 |
| 56 void BrowserFrameWin::Init() { | 60 void BrowserFrameWin::Init() { |
| 57 WindowWin::Init(NULL, gfx::Rect()); | 61 WindowWin::Init(NULL, gfx::Rect()); |
| 58 } | 62 } |
| 59 | 63 |
| 60 BrowserFrameWin::~BrowserFrameWin() { | 64 BrowserFrameWin::~BrowserFrameWin() { |
| 61 } | 65 } |
| 62 | 66 |
| 63 views::Window* BrowserFrameWin::GetWindow() { | 67 views::Window* BrowserFrameWin::GetWindow() { |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 } | 295 } |
| 292 | 296 |
| 293 /////////////////////////////////////////////////////////////////////////////// | 297 /////////////////////////////////////////////////////////////////////////////// |
| 294 // BrowserFrame, views::CustomFrameWindow overrides: | 298 // BrowserFrame, views::CustomFrameWindow overrides: |
| 295 | 299 |
| 296 int BrowserFrameWin::GetShowState() const { | 300 int BrowserFrameWin::GetShowState() const { |
| 297 return browser_view_->GetShowState(); | 301 return browser_view_->GetShowState(); |
| 298 } | 302 } |
| 299 | 303 |
| 300 views::NonClientFrameView* BrowserFrameWin::CreateFrameViewForWindow() { | 304 views::NonClientFrameView* BrowserFrameWin::CreateFrameViewForWindow() { |
| 301 if (GetThemeProvider()->ShouldUseNativeFrame()) | 305 if (GetThemeProvider()->ShouldUseNativeFrame() || |
| 306 (!browser_view_->IsBrowserTypeNormal() && |
| 307 win_util::ShouldUseVistaFrame())) |
| 302 browser_frame_view_ = new GlassBrowserFrameView(this, browser_view_); | 308 browser_frame_view_ = new GlassBrowserFrameView(this, browser_view_); |
| 303 else | 309 else |
| 304 browser_frame_view_ = new OpaqueBrowserFrameView(this, browser_view_); | 310 browser_frame_view_ = new OpaqueBrowserFrameView(this, browser_view_); |
| 305 return browser_frame_view_; | 311 return browser_frame_view_; |
| 306 } | 312 } |
| 307 | 313 |
| 308 void BrowserFrameWin::UpdateFrameAfterFrameChange() { | 314 void BrowserFrameWin::UpdateFrameAfterFrameChange() { |
| 309 WindowWin::UpdateFrameAfterFrameChange(); | 315 WindowWin::UpdateFrameAfterFrameChange(); |
| 310 UpdateDWMFrame(); | 316 UpdateDWMFrame(); |
| 311 } | 317 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 // more "transparent" look. | 368 // more "transparent" look. |
| 363 ::SetWindowLong(frame_hwnd, GWL_STYLE, | 369 ::SetWindowLong(frame_hwnd, GWL_STYLE, |
| 364 saved_window_style_ & ~WS_CAPTION); | 370 saved_window_style_ & ~WS_CAPTION); |
| 365 SetLayeredWindowAttributes(frame_hwnd, RGB(0xFF, 0xFF, 0xFF), | 371 SetLayeredWindowAttributes(frame_hwnd, RGB(0xFF, 0xFF, 0xFF), |
| 366 kTabDragWindowAlpha, LWA_ALPHA); | 372 kTabDragWindowAlpha, LWA_ALPHA); |
| 367 } else { | 373 } else { |
| 368 ::SetWindowLong(frame_hwnd, GWL_STYLE, saved_window_style_); | 374 ::SetWindowLong(frame_hwnd, GWL_STYLE, saved_window_style_); |
| 369 ::SetWindowLong(frame_hwnd, GWL_EXSTYLE, saved_window_ex_style_); | 375 ::SetWindowLong(frame_hwnd, GWL_EXSTYLE, saved_window_ex_style_); |
| 370 } | 376 } |
| 371 } | 377 } |
| OLD | NEW |