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

Side by Side Diff: chrome/browser/ui/bookmarks/bookmark_utils.cc

Issue 2210993002: Stick with old yellow bookmark folder icons on Windows, even in MD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unused fn Created 4 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
« no previous file with comments | « no previous file | no next file » | 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/bookmarks/bookmark_utils.h" 5 #include "chrome/browser/ui/bookmarks/bookmark_utils.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 removed = true; 86 removed = true;
87 } 87 }
88 } 88 }
89 89
90 if (removed) 90 if (removed)
91 return BOOKMARK_SHORTCUT_DISPOSITION_REMOVED; 91 return BOOKMARK_SHORTCUT_DISPOSITION_REMOVED;
92 #endif 92 #endif
93 return BOOKMARK_SHORTCUT_DISPOSITION_UNCHANGED; 93 return BOOKMARK_SHORTCUT_DISPOSITION_UNCHANGED;
94 } 94 }
95 95
96 #if defined(TOOLKIT_VIEWS) 96 #if defined(TOOLKIT_VIEWS) && !defined(OS_WIN)
97 gfx::ImageSkia GetFolderIcon(gfx::VectorIconId id, SkColor text_color) { 97 gfx::ImageSkia GetFolderIcon(gfx::VectorIconId id, SkColor text_color) {
98 return gfx::CreateVectorIcon(id, 98 return gfx::CreateVectorIcon(id,
99 color_utils::DeriveDefaultIconColor(text_color)); 99 color_utils::DeriveDefaultIconColor(text_color));
100 } 100 }
101 #endif 101 #endif
102 102
103 } // namespace 103 } // namespace
104 104
105 GURL GetURLToBookmark(content::WebContents* web_contents) { 105 GURL GetURLToBookmark(content::WebContents* web_contents) {
106 DCHECK(web_contents); 106 DCHECK(web_contents);
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 if (drop_parent->HasAncestor(node)) 277 if (drop_parent->HasAncestor(node))
278 return false; 278 return false;
279 } 279 }
280 return true; 280 return true;
281 } 281 }
282 // From another profile, always accept. 282 // From another profile, always accept.
283 return true; 283 return true;
284 } 284 }
285 285
286 #if defined(TOOLKIT_VIEWS) 286 #if defined(TOOLKIT_VIEWS)
287 // TODO(bsep): vectorize the Windows versions: crbug.com/564112
287 gfx::ImageSkia GetBookmarkFolderIcon(SkColor text_color) { 288 gfx::ImageSkia GetBookmarkFolderIcon(SkColor text_color) {
288 #if defined(OS_WIN) 289 #if defined(OS_WIN)
289 if (!ui::MaterialDesignController::IsModeMaterial()) { 290 return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
290 return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 291 IDR_BOOKMARK_BAR_FOLDER);
291 IDR_BOOKMARK_BAR_FOLDER); 292 #else
292 } 293 return GetFolderIcon(gfx::VectorIconId::FOLDER, text_color);
293 #endif 294 #endif
294
295 return GetFolderIcon(gfx::VectorIconId::FOLDER, text_color);
296 } 295 }
297 296
298 gfx::ImageSkia GetBookmarkSupervisedFolderIcon(SkColor text_color) { 297 gfx::ImageSkia GetBookmarkSupervisedFolderIcon(SkColor text_color) {
299 #if defined(OS_WIN) 298 #if defined(OS_WIN)
300 if (!ui::MaterialDesignController::IsModeMaterial()) { 299 return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
301 return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 300 IDR_BOOKMARK_BAR_FOLDER_SUPERVISED);
302 IDR_BOOKMARK_BAR_FOLDER_SUPERVISED); 301 #else
303 } 302 return GetFolderIcon(gfx::VectorIconId::FOLDER_SUPERVISED, text_color);
304 #endif 303 #endif
305
306 return GetFolderIcon(gfx::VectorIconId::FOLDER_SUPERVISED, text_color);
307 } 304 }
308 305
309 gfx::ImageSkia GetBookmarkManagedFolderIcon(SkColor text_color) { 306 gfx::ImageSkia GetBookmarkManagedFolderIcon(SkColor text_color) {
310 #if defined(OS_WIN) 307 #if defined(OS_WIN)
311 if (!ui::MaterialDesignController::IsModeMaterial()) { 308 return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
312 return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 309 IDR_BOOKMARK_BAR_FOLDER_MANAGED);
313 IDR_BOOKMARK_BAR_FOLDER_MANAGED); 310 #else
314 } 311 return GetFolderIcon(gfx::VectorIconId::FOLDER_MANAGED, text_color);
315 #endif 312 #endif
316
317 return GetFolderIcon(gfx::VectorIconId::FOLDER_MANAGED, text_color);
318 } 313 }
319 #endif 314 #endif
320 315
321 } // namespace chrome 316 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698