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

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

Issue 53058: Middleclick on TabStrip Opens New Tab 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
« no previous file with comments | « chrome/browser/views/frame/browser_frame.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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_root_view.h"
12 #include "chrome/browser/views/frame/browser_view.h" 12 #include "chrome/browser/views/frame/browser_view.h"
13 #include "chrome/browser/views/frame/glass_browser_frame_view.h" 13 #include "chrome/browser/views/frame/glass_browser_frame_view.h"
14 #include "chrome/browser/views/frame/opaque_browser_frame_view.h" 14 #include "chrome/browser/views/frame/opaque_browser_frame_view.h"
15 #include "chrome/browser/views/tabs/tab_strip.h"
15 #include "chrome/common/resource_bundle.h" 16 #include "chrome/common/resource_bundle.h"
16 #include "chrome/common/win_util.h" 17 #include "chrome/common/win_util.h"
17 #include "chrome/views/window/window_delegate.h" 18 #include "chrome/views/window/window_delegate.h"
18 #include "grit/theme_resources.h" 19 #include "grit/theme_resources.h"
19 20
20 // static 21 // static
21 static const int kClientEdgeThickness = 3; 22 static const int kClientEdgeThickness = 3;
22 23
23 /////////////////////////////////////////////////////////////////////////////// 24 ///////////////////////////////////////////////////////////////////////////////
24 // BrowserFrame, public: 25 // BrowserFrame, public:
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 if (GetNonClientView()->UseNativeFrame()) { 177 if (GetNonClientView()->UseNativeFrame()) {
177 LRESULT result; 178 LRESULT result;
178 if (DwmDefWindowProc(GetNativeView(), WM_NCHITTEST, 0, 179 if (DwmDefWindowProc(GetNativeView(), WM_NCHITTEST, 0,
179 MAKELPARAM(pt.x, pt.y), &result)) { 180 MAKELPARAM(pt.x, pt.y), &result)) {
180 return result; 181 return result;
181 } 182 }
182 } 183 }
183 return WindowWin::OnNCHitTest(pt); 184 return WindowWin::OnNCHitTest(pt);
184 } 185 }
185 186
187 void BrowserFrame::OnNCMButtonUp(UINT ht_component, const CPoint& point) {
188 browser_view_->tabstrip()->model()->AddBlankTab(true);
189 }
190
186 /////////////////////////////////////////////////////////////////////////////// 191 ///////////////////////////////////////////////////////////////////////////////
187 // BrowserFrame, views::CustomFrameWindow overrides: 192 // BrowserFrame, views::CustomFrameWindow overrides:
188 193
189 int BrowserFrame::GetShowState() const { 194 int BrowserFrame::GetShowState() const {
190 return browser_view_->GetShowState(); 195 return browser_view_->GetShowState();
191 } 196 }
192 197
193 views::NonClientFrameView* BrowserFrame::CreateFrameViewForWindow() { 198 views::NonClientFrameView* BrowserFrame::CreateFrameViewForWindow() {
194 if (GetNonClientView()->UseNativeFrame()) 199 if (GetNonClientView()->UseNativeFrame())
195 browser_frame_view_ = new GlassBrowserFrameView(this, browser_view_); 200 browser_frame_view_ = new GlassBrowserFrameView(this, browser_view_);
(...skipping 30 matching lines...) Expand all
226 margins.cyBottomHeight = kClientEdgeThickness + 1; 231 margins.cyBottomHeight = kClientEdgeThickness + 1;
227 } 232 }
228 // In maximized mode, we only have a titlebar strip of glass, no side/bottom 233 // In maximized mode, we only have a titlebar strip of glass, no side/bottom
229 // borders. 234 // borders.
230 if (!browser_view_->IsFullscreen()) { 235 if (!browser_view_->IsFullscreen()) {
231 margins.cyTopHeight = 236 margins.cyTopHeight =
232 GetBoundsForTabStrip(browser_view_->tabstrip()).bottom(); 237 GetBoundsForTabStrip(browser_view_->tabstrip()).bottom();
233 } 238 }
234 DwmExtendFrameIntoClientArea(GetNativeView(), &margins); 239 DwmExtendFrameIntoClientArea(GetNativeView(), &margins);
235 } 240 }
OLDNEW
« no previous file with comments | « chrome/browser/views/frame/browser_frame.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698