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

Side by Side Diff: chrome/browser/ui/views/aura/launcher_icon_updater.cc

Issue 8418006: Changes around the launcher so that it only shows the most recently (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | « no previous file | ui/aura_shell/examples/aura_shell_main.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/aura/launcher_icon_updater.h" 5 #include "chrome/browser/ui/views/aura/launcher_icon_updater.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "chrome/browser/extensions/extension_tab_helper.h" 9 #include "chrome/browser/extensions/extension_tab_helper.h"
10 #include "chrome/browser/favicon/favicon_tab_helper.h" 10 #include "chrome/browser/favicon/favicon_tab_helper.h"
11 #include "chrome/browser/tabs/tab_strip_model.h" 11 #include "chrome/browser/tabs/tab_strip_model.h"
12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
13 #include "grit/ui_resources.h" 13 #include "grit/ui_resources.h"
14 #include "ui/aura_shell/launcher/launcher_model.h" 14 #include "ui/aura_shell/launcher/launcher_model.h"
15 #include "ui/aura/window.h" 15 #include "ui/aura/window.h"
16 #include "ui/base/resource/resource_bundle.h" 16 #include "ui/base/resource/resource_bundle.h"
17 17
18 // Max number of tabs we'll send icons over for. 18 // Max number of tabs we'll send icons over for.
19 const int kMaxCount = 2; 19 const int kMaxCount = 3;
20 20
21 LauncherIconUpdater::LauncherIconUpdater( 21 LauncherIconUpdater::LauncherIconUpdater(
22 TabStripModel* tab_model, 22 TabStripModel* tab_model,
23 aura_shell::LauncherModel* launcher_model, 23 aura_shell::LauncherModel* launcher_model,
24 aura::Window* window) 24 aura::Window* window)
25 : tab_model_(tab_model), 25 : tab_model_(tab_model),
26 launcher_model_(launcher_model), 26 launcher_model_(launcher_model),
27 window_(window) { 27 window_(window) {
28 tab_model->AddObserver(this); 28 tab_model->AddObserver(this);
29 if (tab_model->GetActiveTabContents()) 29 if (tab_model->GetActiveTabContents())
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 // TODO: needs to be updated for apps. 112 // TODO: needs to be updated for apps.
113 images[i].image = tabs_[i]->favicon_tab_helper()->GetFavicon(); 113 images[i].image = tabs_[i]->favicon_tab_helper()->GetFavicon();
114 if (images[i].image.empty()) { 114 if (images[i].image.empty()) {
115 images[i].image = *ResourceBundle::GetSharedInstance().GetBitmapNamed( 115 images[i].image = *ResourceBundle::GetSharedInstance().GetBitmapNamed(
116 IDR_DEFAULT_FAVICON); 116 IDR_DEFAULT_FAVICON);
117 } 117 }
118 images[i].user_data = tabs_[i]; 118 images[i].user_data = tabs_[i];
119 } 119 }
120 launcher_model_->SetTabbedImages(item_index, images); 120 launcher_model_->SetTabbedImages(item_index, images);
121 } 121 }
OLDNEW
« no previous file with comments | « no previous file | ui/aura_shell/examples/aura_shell_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698