| OLD | NEW |
| 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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include "extensions/common/extension_set.h" | 38 #include "extensions/common/extension_set.h" |
| 39 #endif | 39 #endif |
| 40 | 40 |
| 41 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) | 41 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) |
| 42 #include "ui/gfx/paint_vector_icon.h" | 42 #include "ui/gfx/paint_vector_icon.h" |
| 43 #include "ui/gfx/vector_icons_public.h" | 43 #include "ui/gfx/vector_icons_public.h" |
| 44 #include "ui/native_theme/common_theme.h" | 44 #include "ui/native_theme/common_theme.h" |
| 45 #include "ui/native_theme/native_theme.h" | 45 #include "ui/native_theme/native_theme.h" |
| 46 #endif | 46 #endif |
| 47 | 47 |
| 48 #if defined(OS_WIN) |
| 49 #include "chrome/grit/theme_resources.h" |
| 50 #include "ui/base/resource/material_design/material_design_controller.h" |
| 51 #include "ui/base/resource/resource_bundle.h" |
| 52 #endif |
| 53 |
| 48 using bookmarks::BookmarkModel; | 54 using bookmarks::BookmarkModel; |
| 49 using bookmarks::BookmarkNode; | 55 using bookmarks::BookmarkNode; |
| 50 | 56 |
| 51 namespace chrome { | 57 namespace chrome { |
| 52 | 58 |
| 53 int num_bookmark_urls_before_prompting = 15; | 59 int num_bookmark_urls_before_prompting = 15; |
| 54 | 60 |
| 55 namespace { | 61 namespace { |
| 56 | 62 |
| 57 // The ways in which extensions may customize the bookmark shortcut. | 63 // The ways in which extensions may customize the bookmark shortcut. |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 return false; | 498 return false; |
| 493 } | 499 } |
| 494 return true; | 500 return true; |
| 495 } | 501 } |
| 496 // From another profile, always accept. | 502 // From another profile, always accept. |
| 497 return true; | 503 return true; |
| 498 } | 504 } |
| 499 | 505 |
| 500 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) | 506 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) |
| 501 gfx::ImageSkia GetBookmarkFolderIcon() { | 507 gfx::ImageSkia GetBookmarkFolderIcon() { |
| 508 #if defined(OS_WIN) |
| 509 if (!ui::MaterialDesignController::IsModeMaterial()) { |
| 510 return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 511 IDR_BOOKMARK_BAR_FOLDER); |
| 512 } |
| 513 #endif |
| 514 |
| 502 return GetFolderIcon(gfx::VectorIconId::FOLDER); | 515 return GetFolderIcon(gfx::VectorIconId::FOLDER); |
| 503 } | 516 } |
| 504 | 517 |
| 505 gfx::ImageSkia GetBookmarkSupervisedFolderIcon() { | 518 gfx::ImageSkia GetBookmarkSupervisedFolderIcon() { |
| 519 #if defined(OS_WIN) |
| 520 if (!ui::MaterialDesignController::IsModeMaterial()) { |
| 521 return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 522 IDR_BOOKMARK_BAR_FOLDER_SUPERVISED); |
| 523 } |
| 524 #endif |
| 525 |
| 506 return GetFolderIcon(gfx::VectorIconId::FOLDER_SUPERVISED); | 526 return GetFolderIcon(gfx::VectorIconId::FOLDER_SUPERVISED); |
| 507 } | 527 } |
| 508 | 528 |
| 509 gfx::ImageSkia GetBookmarkManagedFolderIcon() { | 529 gfx::ImageSkia GetBookmarkManagedFolderIcon() { |
| 530 #if defined(OS_WIN) |
| 531 if (!ui::MaterialDesignController::IsModeMaterial()) { |
| 532 return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 533 IDR_BOOKMARK_BAR_FOLDER_MANAGED); |
| 534 } |
| 535 #endif |
| 536 |
| 510 return GetFolderIcon(gfx::VectorIconId::FOLDER_MANAGED); | 537 return GetFolderIcon(gfx::VectorIconId::FOLDER_MANAGED); |
| 511 } | 538 } |
| 512 #endif | 539 #endif |
| 513 | 540 |
| 514 } // namespace chrome | 541 } // namespace chrome |
| OLD | NEW |