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

Side by Side Diff: chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller.cc

Issue 10837090: Change return type of FaviconTabHelper::GetFavicon() to gfx::Image. (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 | « chrome/browser/ui/panels/panel_host.cc ('k') | chrome/browser/ui/views/hung_renderer_view.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 "chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller. h" 5 #include "chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller. h"
6 6
7 #include "ash/launcher/launcher.h" 7 #include "ash/launcher/launcher.h"
8 #include "ash/launcher/launcher_model.h" 8 #include "ash/launcher/launcher_model.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/wm/window_util.h" 10 #include "ash/wm/window_util.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 // Only update the icon if we have a new image, or none has been set yet. 220 // Only update the icon if we have a new image, or none has been set yet.
221 // This avoids flickering to an empty image when a pinned app is opened. 221 // This avoids flickering to an empty image when a pinned app is opened.
222 if (!new_image.empty()) 222 if (!new_image.empty())
223 item.image = new_image; 223 item.image = new_image;
224 else if (item.image.empty()) 224 else if (item.image.empty())
225 item.image = extensions::Extension::GetDefaultIcon(true); 225 item.image = extensions::Extension::GetDefaultIcon(true);
226 } else { 226 } else {
227 DCHECK_EQ(TYPE_TABBED, type_); 227 DCHECK_EQ(TYPE_TABBED, type_);
228 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 228 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
229 if (tab->favicon_tab_helper()->ShouldDisplayFavicon()) { 229 if (tab->favicon_tab_helper()->ShouldDisplayFavicon()) {
230 item.image = tab->favicon_tab_helper()->GetFavicon(); 230 item.image = tab->favicon_tab_helper()->GetFavicon().AsBitmap();
231 if (item.image.empty()) { 231 if (item.image.empty()) {
232 item.image = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON); 232 item.image = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON);
233 } 233 }
234 } else { 234 } else {
235 item.image = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON); 235 item.image = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON);
236 } 236 }
237 } 237 }
238 launcher_model()->Set(item_index, item); 238 launcher_model()->Set(item_index, item);
239 } 239 }
240 240
241 void BrowserLauncherItemController::UpdateAppState(TabContents* tab) { 241 void BrowserLauncherItemController::UpdateAppState(TabContents* tab) {
242 ChromeLauncherController::AppState app_state; 242 ChromeLauncherController::AppState app_state;
243 243
244 if (tab_model_->GetIndexOfTabContents(tab) == TabStripModel::kNoTab) { 244 if (tab_model_->GetIndexOfTabContents(tab) == TabStripModel::kNoTab) {
245 app_state = ChromeLauncherController::APP_STATE_REMOVED; 245 app_state = ChromeLauncherController::APP_STATE_REMOVED;
246 } else if (tab_model_->GetActiveTabContents() == tab) { 246 } else if (tab_model_->GetActiveTabContents() == tab) {
247 if (ash::wm::IsActiveWindow(window_)) 247 if (ash::wm::IsActiveWindow(window_))
248 app_state = ChromeLauncherController::APP_STATE_WINDOW_ACTIVE; 248 app_state = ChromeLauncherController::APP_STATE_WINDOW_ACTIVE;
249 else 249 else
250 app_state = ChromeLauncherController::APP_STATE_ACTIVE; 250 app_state = ChromeLauncherController::APP_STATE_ACTIVE;
251 } else { 251 } else {
252 app_state = ChromeLauncherController::APP_STATE_INACTIVE; 252 app_state = ChromeLauncherController::APP_STATE_INACTIVE;
253 } 253 }
254 launcher_controller_->UpdateAppState(tab, app_state); 254 launcher_controller_->UpdateAppState(tab, app_state);
255 } 255 }
256 256
257 ash::LauncherModel* BrowserLauncherItemController::launcher_model() { 257 ash::LauncherModel* BrowserLauncherItemController::launcher_model() {
258 return launcher_controller_->model(); 258 return launcher_controller_->model();
259 } 259 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/panel_host.cc ('k') | chrome/browser/ui/views/hung_renderer_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698