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

Side by Side Diff: ui/app_list/page_switcher.cc

Issue 10827271: Replace views::Event with ui::Event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | « ui/app_list/page_switcher.h ('k') | ui/app_list/search_result_list_view.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/app_list/page_switcher.h" 5 #include "ui/app_list/page_switcher.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "third_party/skia/include/core/SkPath.h" 9 #include "third_party/skia/include/core/SkPath.h"
10 #include "ui/app_list/pagination_model.h" 10 #include "ui/app_list/pagination_model.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 std::max(kMinButtonWidth, button_width)); 168 std::max(kMinButtonWidth, button_width));
169 169
170 for (int i = 0; i < button_count; ++i) { 170 for (int i = 0; i < button_count; ++i) {
171 PageSwitcherButton* button = 171 PageSwitcherButton* button =
172 static_cast<PageSwitcherButton*>(buttons_->child_at(i)); 172 static_cast<PageSwitcherButton*>(buttons_->child_at(i));
173 button->set_button_width(button_width); 173 button->set_button_width(button_width);
174 } 174 }
175 } 175 }
176 176
177 void PageSwitcher::ButtonPressed(views::Button* sender, 177 void PageSwitcher::ButtonPressed(views::Button* sender,
178 const views::Event& event) { 178 const ui::Event& event) {
179 for (int i = 0; i < buttons_->child_count(); ++i) { 179 for (int i = 0; i < buttons_->child_count(); ++i) {
180 if (sender == static_cast<views::Button*>(buttons_->child_at(i))) { 180 if (sender == static_cast<views::Button*>(buttons_->child_at(i))) {
181 model_->SelectPage(i, true /* animate */); 181 model_->SelectPage(i, true /* animate */);
182 break; 182 break;
183 } 183 }
184 } 184 }
185 } 185 }
186 186
187 void PageSwitcher::TotalPagesChanged() { 187 void PageSwitcher::TotalPagesChanged() {
188 buttons_->RemoveAllChildViews(true); 188 buttons_->RemoveAllChildViews(true);
(...skipping 24 matching lines...) Expand all
213 remaining = -remaining; 213 remaining = -remaining;
214 progress = -progress; 214 progress = -progress;
215 } 215 }
216 216
217 GetButtonByIndex(buttons_, current_page)->SetSelectedRange(remaining); 217 GetButtonByIndex(buttons_, current_page)->SetSelectedRange(remaining);
218 if (model_->is_valid_page(target_page)) 218 if (model_->is_valid_page(target_page))
219 GetButtonByIndex(buttons_, target_page)->SetSelectedRange(progress); 219 GetButtonByIndex(buttons_, target_page)->SetSelectedRange(progress);
220 } 220 }
221 221
222 } // namespace app_list 222 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/page_switcher.h ('k') | ui/app_list/search_result_list_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698