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: ui/views/controls/single_split_view.cc

Issue 117983002: Prefix string16 with base:: in ui/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 7 years 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 | « ui/views/controls/single_split_view.h ('k') | ui/views/controls/slider.h » ('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 "ui/views/controls/single_split_view.h" 5 #include "ui/views/controls/single_split_view.h"
6 6
7 #include "skia/ext/skia_utils_win.h" 7 #include "skia/ext/skia_utils_win.h"
8 #include "ui/base/accessibility/accessible_view_state.h" 8 #include "ui/base/accessibility/accessible_view_state.h"
9 #include "ui/gfx/canvas.h" 9 #include "ui/gfx/canvas.h"
10 #include "ui/views/background.h" 10 #include "ui/views/background.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 std::max(0, bounds.width() - divider_at - divider_size), 141 std::max(0, bounds.width() - divider_at - divider_size),
142 bounds.height()); 142 bounds.height());
143 } else { 143 } else {
144 *leading_bounds = gfx::Rect(0, 0, bounds.width(), divider_at); 144 *leading_bounds = gfx::Rect(0, 0, bounds.width(), divider_at);
145 *trailing_bounds = 145 *trailing_bounds =
146 gfx::Rect(0, divider_at + divider_size, bounds.width(), 146 gfx::Rect(0, divider_at + divider_size, bounds.width(),
147 std::max(0, bounds.height() - divider_at - divider_size)); 147 std::max(0, bounds.height() - divider_at - divider_size));
148 } 148 }
149 } 149 }
150 150
151 void SingleSplitView::SetAccessibleName(const string16& name) { 151 void SingleSplitView::SetAccessibleName(const base::string16& name) {
152 accessible_name_ = name; 152 accessible_name_ = name;
153 } 153 }
154 154
155 bool SingleSplitView::OnMousePressed(const ui::MouseEvent& event) { 155 bool SingleSplitView::OnMousePressed(const ui::MouseEvent& event) {
156 if (!IsPointInDivider(event.location())) 156 if (!IsPointInDivider(event.location()))
157 return false; 157 return false;
158 drag_info_.initial_mouse_offset = GetPrimaryAxisSize(event.x(), event.y()); 158 drag_info_.initial_mouse_offset = GetPrimaryAxisSize(event.x(), event.y());
159 drag_info_.initial_divider_offset = 159 drag_info_.initial_divider_offset =
160 NormalizeDividerOffset(divider_offset_, bounds()); 160 NormalizeDividerOffset(divider_offset_, bounds());
161 return true; 161 return true;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 const gfx::Rect& bounds) const { 252 const gfx::Rect& bounds) const {
253 int primary_axis_size = GetPrimaryAxisSize(bounds.width(), bounds.height()); 253 int primary_axis_size = GetPrimaryAxisSize(bounds.width(), bounds.height());
254 if (divider_offset < 0) 254 if (divider_offset < 0)
255 // primary_axis_size may < GetDividerSize during initial layout. 255 // primary_axis_size may < GetDividerSize during initial layout.
256 return std::max(0, (primary_axis_size - GetDividerSize()) / 2); 256 return std::max(0, (primary_axis_size - GetDividerSize()) / 2);
257 return std::min(divider_offset, 257 return std::min(divider_offset,
258 std::max(primary_axis_size - GetDividerSize(), 0)); 258 std::max(primary_axis_size - GetDividerSize(), 0));
259 } 259 }
260 260
261 } // namespace views 261 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/single_split_view.h ('k') | ui/views/controls/slider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698