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

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

Issue 2644903004: Move around more vector icons. (Closed)
Patch Set: fix comment Created 3 years, 11 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 (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 14 matching lines...) Expand all
25 #include "ui/base/dragdrop/drag_drop_types.h" 25 #include "ui/base/dragdrop/drag_drop_types.h"
26 #include "ui/base/dragdrop/drop_target_event.h" 26 #include "ui/base/dragdrop/drop_target_event.h"
27 27
28 #if BUILDFLAG(ENABLE_EXTENSIONS) 28 #if BUILDFLAG(ENABLE_EXTENSIONS)
29 #include "chrome/browser/extensions/api/commands/command_service.h" 29 #include "chrome/browser/extensions/api/commands/command_service.h"
30 #include "extensions/browser/extension_registry.h" 30 #include "extensions/browser/extension_registry.h"
31 #include "extensions/common/extension_set.h" 31 #include "extensions/common/extension_set.h"
32 #endif 32 #endif
33 33
34 #if defined(TOOLKIT_VIEWS) 34 #if defined(TOOLKIT_VIEWS)
35 #include "chrome/app/vector_icons/vector_icons.h"
35 #include "ui/gfx/color_utils.h" 36 #include "ui/gfx/color_utils.h"
36 #include "ui/gfx/paint_vector_icon.h" 37 #include "ui/gfx/paint_vector_icon.h"
37 #include "ui/gfx/vector_icons_public.h"
38 #endif 38 #endif
39 39
40 #if defined(OS_WIN) 40 #if defined(OS_WIN)
41 #include "chrome/grit/theme_resources.h" 41 #include "chrome/grit/theme_resources.h"
42 #include "ui/base/material_design/material_design_controller.h" 42 #include "ui/base/material_design/material_design_controller.h"
43 #include "ui/base/resource/resource_bundle.h" 43 #include "ui/base/resource/resource_bundle.h"
44 #endif 44 #endif
45 45
46 using bookmarks::BookmarkModel; 46 using bookmarks::BookmarkModel;
47 using bookmarks::BookmarkNode; 47 using bookmarks::BookmarkNode;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 88 }
89 } 89 }
90 90
91 if (removed) 91 if (removed)
92 return BOOKMARK_SHORTCUT_DISPOSITION_REMOVED; 92 return BOOKMARK_SHORTCUT_DISPOSITION_REMOVED;
93 #endif 93 #endif
94 return BOOKMARK_SHORTCUT_DISPOSITION_UNCHANGED; 94 return BOOKMARK_SHORTCUT_DISPOSITION_UNCHANGED;
95 } 95 }
96 96
97 #if defined(TOOLKIT_VIEWS) && !defined(OS_WIN) 97 #if defined(TOOLKIT_VIEWS) && !defined(OS_WIN)
98 gfx::ImageSkia GetFolderIcon(gfx::VectorIconId id, SkColor text_color) { 98 gfx::ImageSkia GetFolderIcon(const gfx::VectorIcon& icon, SkColor text_color) {
99 return gfx::CreateVectorIcon(id, 99 return gfx::CreateVectorIcon(icon,
100 color_utils::DeriveDefaultIconColor(text_color)); 100 color_utils::DeriveDefaultIconColor(text_color));
101 } 101 }
102 #endif 102 #endif
103 103
104 } // namespace 104 } // namespace
105 105
106 GURL GetURLToBookmark(content::WebContents* web_contents) { 106 GURL GetURLToBookmark(content::WebContents* web_contents) {
107 DCHECK(web_contents); 107 DCHECK(web_contents);
108 return search::IsInstantNTP(web_contents) ? GURL(kChromeUINewTabURL) 108 return search::IsInstantNTP(web_contents) ? GURL(kChromeUINewTabURL)
109 : web_contents->GetURL(); 109 : web_contents->GetURL();
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 return true; 291 return true;
292 } 292 }
293 293
294 #if defined(TOOLKIT_VIEWS) 294 #if defined(TOOLKIT_VIEWS)
295 // TODO(bsep): vectorize the Windows versions: crbug.com/564112 295 // TODO(bsep): vectorize the Windows versions: crbug.com/564112
296 gfx::ImageSkia GetBookmarkFolderIcon(SkColor text_color) { 296 gfx::ImageSkia GetBookmarkFolderIcon(SkColor text_color) {
297 #if defined(OS_WIN) 297 #if defined(OS_WIN)
298 return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 298 return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
299 IDR_BOOKMARK_BAR_FOLDER); 299 IDR_BOOKMARK_BAR_FOLDER);
300 #else 300 #else
301 return GetFolderIcon(gfx::VectorIconId::FOLDER, text_color); 301 return GetFolderIcon(kFolderIcon, text_color);
302 #endif 302 #endif
303 } 303 }
304 304
305 gfx::ImageSkia GetBookmarkSupervisedFolderIcon(SkColor text_color) { 305 gfx::ImageSkia GetBookmarkSupervisedFolderIcon(SkColor text_color) {
306 #if defined(OS_WIN) 306 #if defined(OS_WIN)
307 return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 307 return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
308 IDR_BOOKMARK_BAR_FOLDER_SUPERVISED); 308 IDR_BOOKMARK_BAR_FOLDER_SUPERVISED);
309 #else 309 #else
310 return GetFolderIcon(gfx::VectorIconId::FOLDER_SUPERVISED, text_color); 310 return GetFolderIcon(kFolderSupervisedIcon, text_color);
311 #endif 311 #endif
312 } 312 }
313 313
314 gfx::ImageSkia GetBookmarkManagedFolderIcon(SkColor text_color) { 314 gfx::ImageSkia GetBookmarkManagedFolderIcon(SkColor text_color) {
315 #if defined(OS_WIN) 315 #if defined(OS_WIN)
316 return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 316 return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
317 IDR_BOOKMARK_BAR_FOLDER_MANAGED); 317 IDR_BOOKMARK_BAR_FOLDER_MANAGED);
318 #else 318 #else
319 return GetFolderIcon(gfx::VectorIconId::FOLDER_MANAGED, text_color); 319 return GetFolderIcon(kFolderManagedIcon, text_color);
320 #endif 320 #endif
321 } 321 }
322 #endif 322 #endif
323 323
324 } // namespace chrome 324 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698