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}
diff --git a/ui/app_list/PRESUBMIT.py b/ui/app_list/PRESUBMIT.py
index ec96af4..591fad12 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 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..0d5945c9 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 @@
 
   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..dd955a6c 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 @@
 // 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 @@
 // 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 @@
  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 49a7dec0..73bc8b7b 100644
--- a/ui/app_list/views/apps_grid_view.cc
+++ b/ui/app_list/views/apps_grid_view.cc
@@ -196,7 +196,7 @@
 // "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 @@
   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 474579d1..4df89dd 100644
--- a/ui/app_list/views/contents_animator.h
+++ b/ui/app_list/views/contents_animator.h
@@ -23,7 +23,7 @@
 // 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 @@
 // page pair.
 class DefaultAnimator : public ContentsAnimator {
  public:
-  DefaultAnimator(ContentsView* contents_view);
+  explicit DefaultAnimator(ContentsView* contents_view);
 
   ~DefaultAnimator() override {}
 
@@ -76,7 +76,7 @@
 // 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 @@
 // 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 @@
   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 3bd54d96..46ec816f 100644
--- a/ui/app_list/views/contents_view.h
+++ b/ui/app_list/views/contents_view.h
@@ -45,7 +45,7 @@
 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..a923ba95 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 @@
 // 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());