Skip to content

Commit

Permalink
Fix ui\views include-order errors
Browse files Browse the repository at this point in the history
While testing git "cl presubmit --all" I saw a number of include-order
errors. With the new --files option to "git cl presubmit" these can most
easily be reproduced with:

    git cl presubmit --force --files=ui\views\*.h;ui\views\*.cc

A simplified version of the report is:

    ui\views\controls\native\native_view_host_test_base.cc:8:  Found C++ system header after other header.
    ui\views\controls\textfield\textfield_unittest.h:11:  Found C++ system header after other header.
    ui\views\examples\examples_skia_gold_pixel_diff.cc:22:  Add #include <string> for string
    ui\views\examples\examples_skia_gold_pixel_diff.h:28:  Add #include <string> for string
    ui\views\examples\examples_window.cc:8:  Found C++ system header after other header.
    ui\views\test\combobox_test_api.cc:8:  Found C system header after other header.
    ui\views\test\focus_manager_test.h:11:  Found C++ system header after other header.
    ui\views_content_client\views_content_browser_client.cc:23:  Add #include <utility> for move
    ui\views_content_client\views_content_client_main_parts_aura.cc:18:  Add #include <utility> for move

Many (but not all) of these are from the insertion of the include of
"base/memory/raw_ptr.h" as part of the rewrite in crrev.com/c/3305132.
Some of those includes were inserted in the wrong place.

With this change the "git cl presubmit" invocation above is now clean.

Bug: 1309977
Change-Id: I0e2e5c957044209c946c8ad94d201c9cbeafbbfc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3566748
Reviewed-by: Mike Wasserman <msw@chromium.org>
Reviewed-by: Allen Bauer <kylixrd@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#988763}
  • Loading branch information
randomascii authored and Chromium LUCI CQ committed Apr 5, 2022
1 parent c3962c4 commit 0279b9e
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ui/views/controls/native/native_view_host_test_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// found in the LICENSE file.

#include "ui/views/controls/native/native_view_host_test_base.h"
#include "base/memory/raw_ptr.h"

#include <utility>

#include "base/memory/raw_ptr.h"
#include "ui/views/controls/native/native_view_host.h"
#include "ui/views/widget/widget.h"

Expand Down
2 changes: 1 addition & 1 deletion ui/views/controls/textfield/textfield_unittest.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#ifndef UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_UNITTEST_H_
#define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_UNITTEST_H_

#include "base/memory/raw_ptr.h"
#include "ui/views/controls/textfield/textfield.h"

#include <memory>
#include <string>
#include <utility>

#include "base/memory/raw_ptr.h"
#include "ui/base/clipboard/clipboard.h"
#include "ui/events/event_constants.h"
#include "ui/views/controls/textfield/textfield_controller.h"
Expand Down
2 changes: 2 additions & 0 deletions ui/views/examples/examples_skia_gold_pixel_diff.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "ui/views/examples/examples_skia_gold_pixel_diff.h"

#include <utility>

#include "base/run_loop.h"
#include "ui/snapshot/snapshot.h"
#include "ui/views/examples/examples_window.h"
Expand Down
3 changes: 2 additions & 1 deletion ui/views/examples/examples_skia_gold_pixel_diff.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
#ifndef UI_VIEWS_EXAMPLES_EXAMPLES_SKIA_GOLD_PIXEL_DIFF_H_
#define UI_VIEWS_EXAMPLES_EXAMPLES_SKIA_GOLD_PIXEL_DIFF_H_

#include "ui/base/test/skia_gold_pixel_diff.h"
#include <string>

#include "base/run_loop.h"
#include "ui/base/test/skia_gold_pixel_diff.h"
#include "ui/gfx/image/image.h"
#include "ui/views/examples/examples_exit_code.h"
#include "ui/views/widget/widget.h"
Expand Down
2 changes: 1 addition & 1 deletion ui/views/examples/examples_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// found in the LICENSE file.

#include "ui/views/examples/examples_window.h"
#include "base/memory/raw_ptr.h"

#include <algorithm>
#include <iostream>
Expand All @@ -14,6 +13,7 @@

#include "base/command_line.h"
#include "base/containers/cxx20_erase.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/stl_util.h"
#include "base/strings/string_split.h"
Expand Down
2 changes: 1 addition & 1 deletion ui/views/test/combobox_test_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
// found in the LICENSE file.

#include "ui/views/test/combobox_test_api.h"
#include "base/memory/raw_ptr.h"

#include <stdint.h>

#include <memory>

#include "base/memory/raw_ptr.h"
#include "ui/base/models/menu_model.h"
#include "ui/views/controls/combobox/combobox.h"
#include "ui/views/controls/menu/menu_runner.h"
Expand Down
2 changes: 1 addition & 1 deletion ui/views/test/focus_manager_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
#ifndef UI_VIEWS_TEST_FOCUS_MANAGER_TEST_H_
#define UI_VIEWS_TEST_FOCUS_MANAGER_TEST_H_

#include "base/memory/raw_ptr.h"
#include "ui/views/focus/focus_manager.h"

#include <utility>
#include <vector>

#include "base/memory/raw_ptr.h"
#include "ui/views/focus/widget_focus_manager.h"
#include "ui/views/test/views_test_base.h"
#include "ui/views/widget/widget_delegate.h"
Expand Down
2 changes: 2 additions & 0 deletions ui/views_content_client/views_content_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "ui/views_content_client/views_content_browser_client.h"

#include <utility>

#include "content/public/browser/browser_context.h"
#include "content/public/browser/storage_partition.h"
#include "ui/views_content_client/views_content_client_main_parts.h"
Expand Down

0 comments on commit 0279b9e

Please sign in to comment.