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

Side by Side Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 10560015: Implement base::win::IsMetroProcess. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 8 years, 6 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/ui/views/frame/browser_view.cc ('k') | chrome/common/chrome_paths_win.cc » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/views/tabs/tab_strip.h" 5 #include "chrome/browser/ui/views/tabs/tab_strip.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windowsx.h> 8 #include <windowsx.h>
9 #endif 9 #endif
10 10
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 // . Mouse event generated from touch and the left button is down (the right 994 // . Mouse event generated from touch and the left button is down (the right
995 // button corresponds to a long press, which we want to reorder). 995 // button corresponds to a long press, which we want to reorder).
996 // . Real mouse event and control is down. This is mostly for testing. 996 // . Real mouse event and control is down. This is mostly for testing.
997 if (touch_layout_.get() && 997 if (touch_layout_.get() &&
998 (((event.flags() & ui::EF_FROM_TOUCH) && event.IsLeftMouseButton()) || 998 (((event.flags() & ui::EF_FROM_TOUCH) && event.IsLeftMouseButton()) ||
999 (!(event.flags() & ui::EF_FROM_TOUCH) && event.IsControlDown()))) { 999 (!(event.flags() & ui::EF_FROM_TOUCH) && event.IsControlDown()))) {
1000 move_behavior = TabDragController::MOVE_VISIBILE_TABS; 1000 move_behavior = TabDragController::MOVE_VISIBILE_TABS;
1001 } 1001 }
1002 #if defined(OS_WIN) 1002 #if defined(OS_WIN)
1003 // It doesn't make sense to drag tabs out on metro. 1003 // It doesn't make sense to drag tabs out on metro.
1004 if (base::win::GetMetroModule()) 1004 if (base::win::IsMetroProcess())
1005 detach_behavior = TabDragController::NOT_DETACHABLE; 1005 detach_behavior = TabDragController::NOT_DETACHABLE;
1006 #endif 1006 #endif
1007 drag_controller_.reset(new TabDragController); 1007 drag_controller_.reset(new TabDragController);
1008 drag_controller_->Init( 1008 drag_controller_->Init(
1009 this, tab, tabs, gfx::Point(x, y), tab->GetMirroredXInView(event.x()), 1009 this, tab, tabs, gfx::Point(x, y), tab->GetMirroredXInView(event.x()),
1010 selection_model, detach_behavior, move_behavior); 1010 selection_model, detach_behavior, move_behavior);
1011 } 1011 }
1012 1012
1013 void TabStrip::ContinueDrag(views::View* view, const gfx::Point& location) { 1013 void TabStrip::ContinueDrag(views::View* view, const gfx::Point& location) {
1014 if (drag_controller_.get()) { 1014 if (drag_controller_.get()) {
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after
2282 2282
2283 int mini_tab_count = GetMiniTabCount(); 2283 int mini_tab_count = GetMiniTabCount();
2284 int normal_count = tab_count() - mini_tab_count; 2284 int normal_count = tab_count() - mini_tab_count;
2285 if (normal_count == 0 || normal_count == mini_tab_count) 2285 if (normal_count == 0 || normal_count == mini_tab_count)
2286 return false; 2286 return false;
2287 int x = GetStartXForNormalTabs(); 2287 int x = GetStartXForNormalTabs();
2288 int available_width = width() - x - new_tab_button_width(); 2288 int available_width = width() - x - new_tab_button_width();
2289 return (Tab::GetTouchWidth() * normal_count + 2289 return (Tab::GetTouchWidth() * normal_count +
2290 tab_h_offset() * (normal_count - 1)) > available_width; 2290 tab_h_offset() * (normal_count - 1)) > available_width;
2291 } 2291 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/common/chrome_paths_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698