summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorhendrikw <hendrikw@chromium.org>2014-11-27 16:56:54 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-28 00:57:14 +0000
commitdf64f7ef9eb6e010fbd109d288d88a9fef49317e (patch)
tree2a8961578a54469835cda7640325cf4942ae1c5e /ui
parent4a280c7c6aa34765d6ae22c8541e8f239bbd65bc (diff)
downloadchromium_src-df64f7ef9eb6e010fbd109d288d88a9fef49317e.zip
chromium_src-df64f7ef9eb6e010fbd109d288d88a9fef49317e.tar.gz
chromium_src-df64f7ef9eb6e010fbd109d288d88a9fef49317e.tar.bz2
ui:app_list Presubmit fix
The presubmit wasn't working on app_list because the regular expression was looking for files in a cc/ dir. Also swept app_list folder for any presubmit errors Review URL: https://codereview.chromium.org/730743002 Cr-Commit-Position: refs/heads/master@{#306038}
Diffstat (limited to 'ui')
-rw-r--r--ui/app_list/PRESUBMIT.py25
-rw-r--r--ui/app_list/folder_image.h2
-rw-r--r--ui/app_list/folder_image_unittest.cc3
-rw-r--r--ui/app_list/search_result.h1
-rw-r--r--ui/app_list/views/app_list_view.cc3
-rw-r--r--ui/app_list/views/app_list_view_unittest.cc5
-rw-r--r--ui/app_list/views/apps_grid_view.cc2
-rw-r--r--ui/app_list/views/contents_animator.cc2
-rw-r--r--ui/app_list/views/contents_animator.h10
-rw-r--r--ui/app_list/views/contents_view.h2
-rw-r--r--ui/app_list/views/search_result_page_view.cc2
11 files changed, 27 insertions, 30 deletions
diff --git a/ui/app_list/PRESUBMIT.py b/ui/app_list/PRESUBMIT.py
index ec96af4..591fad1 100644
--- a/ui/app_list/PRESUBMIT.py
+++ b/ui/app_list/PRESUBMIT.py
@@ -7,25 +7,16 @@
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into depot_tools.
"""
-
-CC_SOURCE_FILES=(r'^cc/.*\.(cc|h)$',)
+INCLUDE_CPP_FILES_ONLY = (
+ r'.*\.cc$', r'.*\.h$'
+)
def CheckChangeLintsClean(input_api, output_api):
- input_api.cpplint._cpplint_state.ResetErrorCounts() # reset global state
- source_filter = lambda x: input_api.FilterSourceFile(
- x, white_list=CC_SOURCE_FILES, black_list=None)
- files = [f.AbsoluteLocalPath() for f in
- input_api.AffectedSourceFiles(source_filter)]
- level = 1 # strict, but just warn
-
- for file_name in files:
- input_api.cpplint.ProcessFile(file_name, level)
-
- if not input_api.cpplint._cpplint_state.error_count:
- return []
-
- return [output_api.PresubmitPromptWarning(
- 'Changelist failed cpplint.py check.')]
+ """Makes sure that the ui/app_list/ code is cpplint clean."""
+ sources = lambda x: input_api.FilterSourceFile(
+ x, white_list = INCLUDE_CPP_FILES_ONLY, black_list = None)
+ return input_api.canned_checks.CheckChangeLintsClean(
+ input_api, output_api, sources)
def CheckChangeOnUpload(input_api, output_api):
results = []
diff --git a/ui/app_list/folder_image.h b/ui/app_list/folder_image.h
index 7217d0e..3006a86 100644
--- a/ui/app_list/folder_image.h
+++ b/ui/app_list/folder_image.h
@@ -37,7 +37,7 @@ class APP_LIST_EXPORT FolderImageObserver {
class APP_LIST_EXPORT FolderImage : public AppListItemListObserver,
public AppListItemObserver {
public:
- FolderImage(AppListItemList* item_list);
+ explicit FolderImage(AppListItemList* item_list);
~FolderImage() override;
// Generates the folder's icon from the icons of the items in the item list,
diff --git a/ui/app_list/folder_image_unittest.cc b/ui/app_list/folder_image_unittest.cc
index 0d2ad9b..0d5945c 100644
--- a/ui/app_list/folder_image_unittest.cc
+++ b/ui/app_list/folder_image_unittest.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <string>
+
#include "ui/app_list/folder_image.h"
#include "base/macros.h"
@@ -83,6 +85,7 @@ class FolderImageTest : public testing::Test {
TestFolderImageObserver observer_;
+ private:
DISALLOW_COPY_AND_ASSIGN(FolderImageTest);
};
diff --git a/ui/app_list/search_result.h b/ui/app_list/search_result.h
index 9db0f63..dd955a6 100644
--- a/ui/app_list/search_result.h
+++ b/ui/app_list/search_result.h
@@ -5,6 +5,7 @@
#ifndef UI_APP_LIST_SEARCH_RESULT_H_
#define UI_APP_LIST_SEARCH_RESULT_H_
+#include <string>
#include <vector>
#include "base/basictypes.h"
diff --git a/ui/app_list/views/app_list_view.cc b/ui/app_list/views/app_list_view.cc
index a7ed683..eff6ed52 100644
--- a/ui/app_list/views/app_list_view.cc
+++ b/ui/app_list/views/app_list_view.cc
@@ -86,7 +86,8 @@ bool SupportsShadow() {
// rectangle with the given radius.
class AppListOverlayView : public views::View {
public:
- AppListOverlayView(int corner_radius) : corner_radius_(corner_radius) {
+ explicit AppListOverlayView(int corner_radius)
+ : corner_radius_(corner_radius) {
SetPaintToLayer(true);
SetVisible(false);
layer()->SetOpacity(0.0f);
diff --git a/ui/app_list/views/app_list_view_unittest.cc b/ui/app_list/views/app_list_view_unittest.cc
index 65fe98a..4638791 100644
--- a/ui/app_list/views/app_list_view_unittest.cc
+++ b/ui/app_list/views/app_list_view_unittest.cc
@@ -158,7 +158,8 @@ class AppListViewTestContext {
// delegate is owned by the view.
class UnitTestViewDelegate : public app_list::test::AppListTestViewDelegate {
public:
- UnitTestViewDelegate(AppListViewTestContext* parent) : parent_(parent) {}
+ explicit UnitTestViewDelegate(AppListViewTestContext* parent)
+ : parent_(parent) {}
// Overridden from app_list::AppListViewDelegate:
bool ShouldCenterWindow() const override {
@@ -701,7 +702,7 @@ class AppListViewTestDesktop : public views::ViewsTestBase,
private:
class AppListViewTestViewsDelegate : public views::TestViewsDelegate {
public:
- AppListViewTestViewsDelegate(AppListViewTestDesktop* parent)
+ explicit AppListViewTestViewsDelegate(AppListViewTestDesktop* parent)
: parent_(parent) {}
// Overridden from views::ViewsDelegate:
diff --git a/ui/app_list/views/apps_grid_view.cc b/ui/app_list/views/apps_grid_view.cc
index 49a7dec..73bc8b7 100644
--- a/ui/app_list/views/apps_grid_view.cc
+++ b/ui/app_list/views/apps_grid_view.cc
@@ -196,7 +196,7 @@ class ItemRemoveAnimationDelegate : public gfx::AnimationDelegate {
// "zoom out" case when releasing an item being dragged.
class ItemMoveAnimationDelegate : public gfx::AnimationDelegate {
public:
- ItemMoveAnimationDelegate(views::View* view) : view_(view) {}
+ explicit ItemMoveAnimationDelegate(views::View* view) : view_(view) {}
void AnimationEnded(const gfx::Animation* animation) override {
view_->SchedulePaint();
diff --git a/ui/app_list/views/contents_animator.cc b/ui/app_list/views/contents_animator.cc
index f1d4eac9..c8ab7ea 100644
--- a/ui/app_list/views/contents_animator.cc
+++ b/ui/app_list/views/contents_animator.cc
@@ -151,4 +151,4 @@ void StartToCustomAnimator::Update(double progress,
contents_view()->GetPageView(custom_page)->SetBoundsRect(custom_page_rect);
}
-} // app_list
+} // namespace app_list
diff --git a/ui/app_list/views/contents_animator.h b/ui/app_list/views/contents_animator.h
index 474579d..4df89dd 100644
--- a/ui/app_list/views/contents_animator.h
+++ b/ui/app_list/views/contents_animator.h
@@ -23,7 +23,7 @@ class ContentsView;
// implemented, B -> A will implicitly be the inverse animation).
class ContentsAnimator {
public:
- ContentsAnimator(ContentsView* contents_view);
+ explicit ContentsAnimator(ContentsView* contents_view);
virtual ~ContentsAnimator();
@@ -62,7 +62,7 @@ class ContentsAnimator {
// page pair.
class DefaultAnimator : public ContentsAnimator {
public:
- DefaultAnimator(ContentsView* contents_view);
+ explicit DefaultAnimator(ContentsView* contents_view);
~DefaultAnimator() override {}
@@ -76,7 +76,7 @@ class DefaultAnimator : public ContentsAnimator {
// Animator between the start page and apps grid page.
class StartToAppsAnimator : public ContentsAnimator {
public:
- StartToAppsAnimator(ContentsView* contents_view);
+ explicit StartToAppsAnimator(ContentsView* contents_view);
~StartToAppsAnimator() override {}
@@ -90,7 +90,7 @@ class StartToAppsAnimator : public ContentsAnimator {
// Animator from start page to custom page.
class StartToCustomAnimator : public ContentsAnimator {
public:
- StartToCustomAnimator(ContentsView* contents_view);
+ explicit StartToCustomAnimator(ContentsView* contents_view);
std::string NameForTests() const override;
void Update(double progress, int start_page, int custom_page) override;
@@ -98,6 +98,6 @@ class StartToCustomAnimator : public ContentsAnimator {
DISALLOW_COPY_AND_ASSIGN(StartToCustomAnimator);
};
-} // app_list
+} // namespace app_list
#endif // UI_APP_LIST_VIEWS_CONTENTS_ANIMATOR_H_
diff --git a/ui/app_list/views/contents_view.h b/ui/app_list/views/contents_view.h
index 3bd54d9..46ec816 100644
--- a/ui/app_list/views/contents_view.h
+++ b/ui/app_list/views/contents_view.h
@@ -45,7 +45,7 @@ class StartPageView;
class APP_LIST_EXPORT ContentsView : public views::View,
public PaginationModelObserver {
public:
- ContentsView(AppListMainView* app_list_main_view);
+ explicit ContentsView(AppListMainView* app_list_main_view);
~ContentsView() override;
// Initialize the pages of the launcher. In the experimental launcher, should
diff --git a/ui/app_list/views/search_result_page_view.cc b/ui/app_list/views/search_result_page_view.cc
index 2c68a9d..a923ba9 100644
--- a/ui/app_list/views/search_result_page_view.cc
+++ b/ui/app_list/views/search_result_page_view.cc
@@ -25,7 +25,7 @@ const int kTopPadding = 5;
// in the correct order.
class SearchCardView : public views::View {
public:
- SearchCardView(views::View* content_view) {
+ explicit SearchCardView(views::View* content_view) {
SetBorder(make_scoped_ptr(new views::ShadowBorder(
kCardShadowBlur, kCardShadowColor, kCardShadowYOffset, 0)));
SetLayoutManager(new views::FillLayout());