Commit f64595c1 authored by Jiaquan He's avatar Jiaquan He Committed by Commit Bot

app_list: move GetPreferredIconDimension from app_list_util to app_list_constants.

Bug: 733662
Change-Id: I3db2d80a9a8edab1609b12deac96f320a9630273
Reviewed-on: https://chromium-review.googlesource.com/1026848Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Jiaquan He <hejq@google.com>
Cr-Commit-Position: refs/heads/master@{#553701}
parent 6cb06fe1
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "chrome/browser/ui/app_list/arc/arc_app_icon_loader.h" #include "chrome/browser/ui/app_list/arc/arc_app_icon_loader.h"
#include "chrome/browser/ui/app_list/arc/arc_app_utils.h" #include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
#include "chrome/browser/ui/app_list/search/search_util.h" #include "chrome/browser/ui/app_list/search/search_util.h"
#include "ui/app_list/app_list_util.h" #include "ui/app_list/app_list_constants.h"
namespace { namespace {
const char kArcAppPrefix[] = "arc://"; const char kArcAppPrefix[] = "arc://";
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
#include "extensions/common/extension.h" #include "extensions/common/extension.h"
#include "extensions/common/extension_icon_set.h" #include "extensions/common/extension_icon_set.h"
#include "extensions/common/manifest_handlers/icons_handler.h" #include "extensions/common/manifest_handlers/icons_handler.h"
#include "ui/app_list/app_list_constants.h"
#include "ui/app_list/app_list_switches.h" #include "ui/app_list/app_list_switches.h"
#include "ui/app_list/app_list_util.h"
#include "ui/events/event_constants.h" #include "ui/events/event_constants.h"
namespace app_list { namespace app_list {
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "chrome/browser/chromeos/launcher_search_provider/launcher_search_provider_service.h" #include "chrome/browser/chromeos/launcher_search_provider/launcher_search_provider_service.h"
#include "chrome/browser/ui/app_list/search/launcher_search/launcher_search_icon_image_loader_impl.h" #include "chrome/browser/ui/app_list/search/launcher_search/launcher_search_icon_image_loader_impl.h"
#include "chrome/browser/ui/app_list/search/search_util.h" #include "chrome/browser/ui/app_list/search/search_util.h"
#include "ui/app_list/app_list_util.h" #include "ui/app_list/app_list_constants.h"
using chromeos::launcher_search_provider::Service; using chromeos::launcher_search_provider::Service;
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "extensions/browser/extension_system.h" #include "extensions/browser/extension_system.h"
#include "extensions/common/extension_urls.h" #include "extensions/common/extension_urls.h"
#include "net/base/url_util.h" #include "net/base/url_util.h"
#include "ui/app_list/app_list_util.h" #include "ui/app_list/app_list_constants.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
......
...@@ -282,4 +282,21 @@ const gfx::FontList& AppListAppTitleFont() { ...@@ -282,4 +282,21 @@ const gfx::FontList& AppListAppTitleFont() {
return kAppListAppTitleFont; return kAppListAppTitleFont;
} }
int GetPreferredIconDimension(ash::SearchResultDisplayType display_type) {
switch (display_type) {
case ash::SearchResultDisplayType::kRecommendation: // Falls through.
case ash::SearchResultDisplayType::kTile:
return kTileIconSize;
case ash::SearchResultDisplayType::kList:
return kListIconSize;
case ash::SearchResultDisplayType::kNone:
case ash::SearchResultDisplayType::kCard:
return 0;
case ash::SearchResultDisplayType::kLast:
break;
}
NOTREACHED();
return 0;
}
} // namespace app_list } // namespace app_list
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <stddef.h> #include <stddef.h>
#include "ash/public/cpp/app_list/app_list_types.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkColor.h"
#include "ui/app_list/app_list_export.h" #include "ui/app_list/app_list_export.h"
...@@ -201,6 +202,10 @@ APP_LIST_EXPORT const gfx::ShadowValues& IconEndShadows(); ...@@ -201,6 +202,10 @@ APP_LIST_EXPORT const gfx::ShadowValues& IconEndShadows();
APP_LIST_EXPORT const gfx::FontList& AppListAppTitleFont(); APP_LIST_EXPORT const gfx::FontList& AppListAppTitleFont();
// Returns the dimension at which a result's icon should be displayed.
APP_LIST_EXPORT int GetPreferredIconDimension(
ash::SearchResultDisplayType display_type);
} // namespace app_list } // namespace app_list
#endif // UI_APP_LIST_APP_LIST_CONSTANTS_H_ #endif // UI_APP_LIST_APP_LIST_CONSTANTS_H_
...@@ -77,21 +77,4 @@ bool ProcessLeftRightKeyTraversalForTextfield(views::Textfield* textfield, ...@@ -77,21 +77,4 @@ bool ProcessLeftRightKeyTraversalForTextfield(views::Textfield* textfield,
return true; return true;
} }
int GetPreferredIconDimension(SearchResult::DisplayType display_type) {
switch (display_type) {
case ash::SearchResultDisplayType::kRecommendation: // Falls through.
case ash::SearchResultDisplayType::kTile:
return kTileIconSize;
case ash::SearchResultDisplayType::kList:
return kListIconSize;
case ash::SearchResultDisplayType::kNone:
case ash::SearchResultDisplayType::kCard:
return 0;
case ash::SearchResultDisplayType::kLast:
break;
}
NOTREACHED();
return 0;
}
} // namespace app_list } // namespace app_list
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#ifndef UI_APP_LIST_APP_LIST_UTIL_H_ #ifndef UI_APP_LIST_APP_LIST_UTIL_H_
#define UI_APP_LIST_APP_LIST_UTIL_H_ #define UI_APP_LIST_APP_LIST_UTIL_H_
#include "ash/app_list/model/search/search_result.h"
#include "ui/app_list/app_list_export.h" #include "ui/app_list/app_list_export.h"
#include "ui/events/event.h" #include "ui/events/event.h"
...@@ -29,10 +28,6 @@ APP_LIST_EXPORT bool ProcessLeftRightKeyTraversalForTextfield( ...@@ -29,10 +28,6 @@ APP_LIST_EXPORT bool ProcessLeftRightKeyTraversalForTextfield(
views::Textfield* textfield, views::Textfield* textfield,
const ui::KeyEvent& key_event); const ui::KeyEvent& key_event);
// Returns the dimension at which a result's icon should be displayed.
APP_LIST_EXPORT int GetPreferredIconDimension(
ash::SearchResultDisplayType display_type);
} // namespace app_list } // namespace app_list
#endif // UI_APP_LIST_APP_LIST_UTIL_H_ #endif // UI_APP_LIST_APP_LIST_UTIL_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment