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

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

Issue 10638018: app_list: Initialize more views in the initializer list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « ui/app_list/apps_grid_view.cc ('k') | ui/app_list/pagination_model.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 "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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 PageSwitcherButton* GetButtonByIndex(views::View* buttons, int index) { 116 PageSwitcherButton* GetButtonByIndex(views::View* buttons, int index) {
117 return static_cast<PageSwitcherButton*>(buttons->child_at(index)); 117 return static_cast<PageSwitcherButton*>(buttons->child_at(index));
118 } 118 }
119 119
120 } // namespace 120 } // namespace
121 121
122 namespace app_list { 122 namespace app_list {
123 123
124 PageSwitcher::PageSwitcher(PaginationModel* model) 124 PageSwitcher::PageSwitcher(PaginationModel* model)
125 : model_(model), 125 : model_(model),
126 buttons_(NULL) { 126 buttons_(new views::View) {
127 buttons_ = new views::View;
128 buttons_->SetLayoutManager(new views::BoxLayout( 127 buttons_->SetLayoutManager(new views::BoxLayout(
129 views::BoxLayout::kHorizontal, 0, 0, kButtonSpacing)); 128 views::BoxLayout::kHorizontal, 0, 0, kButtonSpacing));
130 AddChildView(buttons_); 129 AddChildView(buttons_);
131 130
132 TotalPagesChanged(); 131 TotalPagesChanged();
133 SelectedPageChanged(-1, model->selected_page()); 132 SelectedPageChanged(-1, model->selected_page());
134 model_->AddObserver(this); 133 model_->AddObserver(this);
135 } 134 }
136 135
137 PageSwitcher::~PageSwitcher() { 136 PageSwitcher::~PageSwitcher() {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 remaining = -remaining; 213 remaining = -remaining;
215 progress = -progress; 214 progress = -progress;
216 } 215 }
217 216
218 GetButtonByIndex(buttons_, current_page)->SetSelectedRange(remaining); 217 GetButtonByIndex(buttons_, current_page)->SetSelectedRange(remaining);
219 if (model_->is_valid_page(target_page)) 218 if (model_->is_valid_page(target_page))
220 GetButtonByIndex(buttons_, target_page)->SetSelectedRange(progress); 219 GetButtonByIndex(buttons_, target_page)->SetSelectedRange(progress);
221 } 220 }
222 221
223 } // namespace app_list 222 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/apps_grid_view.cc ('k') | ui/app_list/pagination_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698