| OLD | NEW | 
|    1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |    1 // Copyright (c) 2010 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 <set> |   10 #include <set> | 
|   11  |   11  | 
|   12 #include "app/win_util.h" |   12 #include "app/win_util.h" | 
|   13 #include "base/win_util.h" |   13 #include "base/win_util.h" | 
|   14 #include "chrome/browser/accessibility/browser_accessibility_state.h" |   14 #include "chrome/browser/accessibility/browser_accessibility_state.h" | 
|   15 #include "chrome/browser/profiles/profile.h" |   15 #include "chrome/browser/profiles/profile.h" | 
|   16 #include "chrome/browser/browser_list.h" |   16 #include "chrome/browser/browser_list.h" | 
|   17 #include "chrome/browser/themes/browser_theme_provider.h" |   17 #include "chrome/browser/themes/browser_theme_provider.h" | 
|   18 #include "chrome/browser/views/frame/app_panel_browser_frame_view.h" |  | 
|   19 #include "chrome/browser/views/frame/browser_non_client_frame_view.h" |   18 #include "chrome/browser/views/frame/browser_non_client_frame_view.h" | 
|   20 #include "chrome/browser/views/frame/browser_root_view.h" |   19 #include "chrome/browser/views/frame/browser_root_view.h" | 
|   21 #include "chrome/browser/views/frame/browser_view.h" |   20 #include "chrome/browser/views/frame/browser_view.h" | 
|   22 #include "chrome/browser/views/frame/glass_browser_frame_view.h" |   21 #include "chrome/browser/views/frame/glass_browser_frame_view.h" | 
|   23 #include "chrome/browser/views/frame/opaque_browser_frame_view.h" |  | 
|   24 #include "grit/theme_resources.h" |   22 #include "grit/theme_resources.h" | 
|   25 #include "views/screen.h" |   23 #include "views/screen.h" | 
|   26 #include "views/window/window_delegate.h" |   24 #include "views/window/window_delegate.h" | 
|   27  |   25  | 
|   28 // static |   26 // static | 
|   29 static const int kClientEdgeThickness = 3; |   27 static const int kClientEdgeThickness = 3; | 
|   30 static const int kTabDragWindowAlpha = 200; |   28 static const int kTabDragWindowAlpha = 200; | 
|   31 // We need to offset the DWMFrame into the toolbar so that the blackness |   29 // We need to offset the DWMFrame into the toolbar so that the blackness | 
|   32 // doesn't show up on our rounded corners. |   30 // doesn't show up on our rounded corners. | 
|   33 static const int kDWMFrameTopOffset = 3; |   31 static const int kDWMFrameTopOffset = 3; | 
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  259   // as the last active browser window to ensure that we get treated as such by |  257   // as the last active browser window to ensure that we get treated as such by | 
|  260   // the rest of Chrome. |  258   // the rest of Chrome. | 
|  261   BrowserList::SetLastActive(browser_view_->browser()); |  259   BrowserList::SetLastActive(browser_view_->browser()); | 
|  262  |  260  | 
|  263   WindowWin::Activate(); |  261   WindowWin::Activate(); | 
|  264 } |  262 } | 
|  265  |  263  | 
|  266 views::NonClientFrameView* BrowserFrameWin::CreateFrameViewForWindow() { |  264 views::NonClientFrameView* BrowserFrameWin::CreateFrameViewForWindow() { | 
|  267   if (AlwaysUseNativeFrame()) |  265   if (AlwaysUseNativeFrame()) | 
|  268     browser_frame_view_ = new GlassBrowserFrameView(this, browser_view_); |  266     browser_frame_view_ = new GlassBrowserFrameView(this, browser_view_); | 
|  269   else if (browser_view_->IsBrowserTypePanel()) |  | 
|  270     browser_frame_view_ = new AppPanelBrowserFrameView(this, browser_view_); |  | 
|  271   else |  267   else | 
|  272     browser_frame_view_ = new OpaqueBrowserFrameView(this, browser_view_); |  268     browser_frame_view_ = | 
 |  269         browser::CreateBrowserNonClientFrameView(this, browser_view_); | 
|  273   return browser_frame_view_; |  270   return browser_frame_view_; | 
|  274 } |  271 } | 
|  275  |  272  | 
|  276 void BrowserFrameWin::UpdateFrameAfterFrameChange() { |  273 void BrowserFrameWin::UpdateFrameAfterFrameChange() { | 
|  277   // We need to update the glass region on or off before the base class adjusts |  274   // We need to update the glass region on or off before the base class adjusts | 
|  278   // the window region. |  275   // the window region. | 
|  279   UpdateDWMFrame(); |  276   UpdateDWMFrame(); | 
|  280   WindowWin::UpdateFrameAfterFrameChange(); |  277   WindowWin::UpdateFrameAfterFrameChange(); | 
|  281 } |  278 } | 
|  282  |  279  | 
| (...skipping 27 matching lines...) Expand all  Loading... | 
|  310       gfx::Rect tabstrip_bounds( |  307       gfx::Rect tabstrip_bounds( | 
|  311           GetBoundsForTabStrip(browser_view_->tabstrip())); |  308           GetBoundsForTabStrip(browser_view_->tabstrip())); | 
|  312       margins.cyTopHeight = (browser_view_->UseVerticalTabs() ? |  309       margins.cyTopHeight = (browser_view_->UseVerticalTabs() ? | 
|  313           tabstrip_bounds.y() : tabstrip_bounds.bottom()) + kDWMFrameTopOffset; |  310           tabstrip_bounds.y() : tabstrip_bounds.bottom()) + kDWMFrameTopOffset; | 
|  314     } |  311     } | 
|  315   } else { |  312   } else { | 
|  316     // For popup and app windows we want to use the default margins. |  313     // For popup and app windows we want to use the default margins. | 
|  317   } |  314   } | 
|  318   DwmExtendFrameIntoClientArea(GetNativeView(), &margins); |  315   DwmExtendFrameIntoClientArea(GetNativeView(), &margins); | 
|  319 } |  316 } | 
| OLD | NEW |