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

Side by Side Diff: chrome/browser/ui/libgtk2ui/app_indicator_icon.cc

Issue 126103003: Changed RefCountedStaticMemory() to accept a void pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 10 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/libgtk2ui/app_indicator_icon.h" 5 #include "chrome/browser/ui/libgtk2ui/app_indicator_icon.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 #include <dlfcn.h> 8 #include <dlfcn.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 138
139 // Create a new temporary directory for each image since using a single 139 // Create a new temporary directory for each image since using a single
140 // temporary directory seems to have issues when changing icons in quick 140 // temporary directory seems to have issues when changing icons in quick
141 // succession. 141 // succession.
142 if (!base::CreateNewTempDirectory(base::FilePath::StringType(), &temp_dir)) 142 if (!base::CreateNewTempDirectory(base::FilePath::StringType(), &temp_dir))
143 return base::FilePath(); 143 return base::FilePath();
144 new_file_path = 144 new_file_path =
145 temp_dir.Append(id + base::StringPrintf("_%d.png", icon_change_count)); 145 temp_dir.Append(id + base::StringPrintf("_%d.png", icon_change_count));
146 int bytes_written = 146 int bytes_written =
147 file_util::WriteFile(new_file_path, 147 file_util::WriteFile(new_file_path,
148 reinterpret_cast<const char*>(png_data->front()), 148 png_data->front_as<char>(),
149 png_data->size()); 149 png_data->size());
150 150
151 if (bytes_written != static_cast<int>(png_data->size())) 151 if (bytes_written != static_cast<int>(png_data->size()))
152 return base::FilePath(); 152 return base::FilePath();
153 return new_file_path; 153 return new_file_path;
154 } 154 }
155 155
156 void DeleteTempImagePath(const base::FilePath& icon_file_path) { 156 void DeleteTempImagePath(const base::FilePath& icon_file_path) {
157 if (icon_file_path.empty()) 157 if (icon_file_path.empty())
158 return; 158 return;
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 int id; 363 int id;
364 if (!GetMenuItemID(menu_item, &id)) 364 if (!GetMenuItemID(menu_item, &id))
365 return; 365 return;
366 366
367 // The menu item can still be activated by hotkeys even if it is disabled. 367 // The menu item can still be activated by hotkeys even if it is disabled.
368 if (menu_model_->IsEnabledAt(id)) 368 if (menu_model_->IsEnabledAt(id))
369 ExecuteCommand(model, id); 369 ExecuteCommand(model, id);
370 } 370 }
371 371
372 } // namespace libgtk2ui 372 } // namespace libgtk2ui
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_navigator_browsertest.cc ('k') | chrome/browser/ui/webui/ntp/thumbnail_list_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698