| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #import "chrome/browser/cocoa/tabpose_window.h" | 5 #import "chrome/browser/cocoa/tabpose_window.h" |
| 6 | 6 |
| 7 #import <QuartzCore/QuartzCore.h> | 7 #import <QuartzCore/QuartzCore.h> |
| 8 | 8 |
| 9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 10 #include "base/mac_util.h" | 10 #include "base/mac_util.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 193 |
| 194 int selected_index() const { return selected_index_; } | 194 int selected_index() const { return selected_index_; } |
| 195 void set_selected_index(int index); | 195 void set_selected_index(int index); |
| 196 void ResetSelectedIndex() { selected_index_ = initial_index_; } | 196 void ResetSelectedIndex() { selected_index_ = initial_index_; } |
| 197 | 197 |
| 198 const Tile& selected_tile() const { return *tiles_[selected_index()]; } | 198 const Tile& selected_tile() const { return *tiles_[selected_index()]; } |
| 199 Tile& tile_at(int index) { return *tiles_[index]; } | 199 Tile& tile_at(int index) { return *tiles_[index]; } |
| 200 const Tile& tile_at(int index) const { return *tiles_[index]; } | 200 const Tile& tile_at(int index) const { return *tiles_[index]; } |
| 201 | 201 |
| 202 private: | 202 private: |
| 203 std::vector<Tile*> tiles_; | 203 ScopedVector<Tile> tiles_; |
| 204 | 204 |
| 205 int selected_index_; | 205 int selected_index_; |
| 206 int initial_index_; | 206 int initial_index_; |
| 207 }; | 207 }; |
| 208 | 208 |
| 209 void TileSet::Build(TabStripModel* source_model) { | 209 void TileSet::Build(TabStripModel* source_model) { |
| 210 selected_index_ = initial_index_ = source_model->selected_index(); | 210 selected_index_ = initial_index_ = source_model->selected_index(); |
| 211 tiles_.resize(source_model->count()); | 211 tiles_.resize(source_model->count()); |
| 212 for (size_t i = 0; i < tiles_.size(); ++i) { | 212 for (size_t i = 0; i < tiles_.size(); ++i) { |
| 213 tiles_[i] = new Tile; | 213 tiles_[i] = new Tile; |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 for (CALayer* layer in allThumbnailLayers_.get()) | 727 for (CALayer* layer in allThumbnailLayers_.get()) |
| 728 layer.shadowOpacity = 0.5; | 728 layer.shadowOpacity = 0.5; |
| 729 } | 729 } |
| 730 } else if ([animationId isEqualToString:kAnimationIdFadeOut]) { | 730 } else if ([animationId isEqualToString:kAnimationIdFadeOut]) { |
| 731 DCHECK_EQ(tabpose::kFadingOut, state_); | 731 DCHECK_EQ(tabpose::kFadingOut, state_); |
| 732 [self close]; | 732 [self close]; |
| 733 } | 733 } |
| 734 } | 734 } |
| 735 | 735 |
| 736 @end | 736 @end |
| OLD | NEW |