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

Side by Side Diff: chrome/browser/ui/views/browser_action_view.cc

Issue 10914244: Remove support for page_action.icons, and the legacy code surrounding it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: constants removed Created 8 years, 3 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
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/browser_action_view.h" 5 #include "chrome/browser/ui/views/browser_action_view.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/extensions/api/commands/command_service.h" 8 #include "chrome/browser/extensions/api/commands/command_service.h"
9 #include "chrome/browser/extensions/api/commands/command_service_factory.h" 9 #include "chrome/browser/extensions/api/commands/command_service_factory.h"
10 #include "chrome/browser/extensions/extension_context_menu_model.h" 10 #include "chrome/browser/extensions/extension_context_menu_model.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 } 209 }
210 210
211 menu_runner_.reset(); 211 menu_runner_.reset();
212 SetButtonNotPushed(); 212 SetButtonNotPushed();
213 context_menu_ = NULL; 213 context_menu_ = NULL;
214 } 214 }
215 215
216 void BrowserActionButton::OnImageLoaded(const gfx::Image& image, 216 void BrowserActionButton::OnImageLoaded(const gfx::Image& image,
217 const std::string& extension_id, 217 const std::string& extension_id,
218 int index) { 218 int index) {
219 browser_action_->CacheIcon(browser_action_->default_icon_path(), image); 219 browser_action_->CacheIcon(image);
220 220
221 // Call back to UpdateState() because a more specific icon might have been set 221 // Call back to UpdateState() because a more specific icon might have been set
222 // while the load was outstanding. 222 // while the load was outstanding.
223 UpdateState(); 223 UpdateState();
224 } 224 }
225 225
226 void BrowserActionButton::UpdateState() { 226 void BrowserActionButton::UpdateState() {
227 int tab_id = delegate_->GetCurrentTabId(); 227 int tab_id = delegate_->GetCurrentTabId();
228 if (tab_id < 0) 228 if (tab_id < 0)
229 return; 229 return;
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 410
411 extensions::Command browser_action_command; 411 extensions::Command browser_action_command;
412 if (!only_if_active || !command_service->GetBrowserActionCommand( 412 if (!only_if_active || !command_service->GetBrowserActionCommand(
413 extension_->id(), 413 extension_->id(),
414 extensions::CommandService::ACTIVE_ONLY, 414 extensions::CommandService::ACTIVE_ONLY,
415 &browser_action_command, 415 &browser_action_command,
416 NULL)) { 416 NULL)) {
417 GetFocusManager()->UnregisterAccelerator(*keybinding_.get(), this); 417 GetFocusManager()->UnregisterAccelerator(*keybinding_.get(), this);
418 } 418 }
419 } 419 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/location_bar_view_gtk.cc ('k') | chrome/browser/ui/views/location_bar/page_action_image_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698