Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Issue 1203713002: Limit access to ChromeBookmarkClient to bookmarks code (Closed)

Created:
5 years, 6 months ago by sdefresne
Modified:
5 years, 5 months ago
Reviewers:
sky
CC:
browser-components-watch_chromium.org, chromium-apps-reviews_chromium.org, chromium-reviews, dcheng, extensions-reviews_chromium.org, maniscalco+watch_chromium.org, maxbogue+watch_chromium.org, noyau+watch_chromium.org, plaree+watch_chromium.org, pvalenzuela+watch_chromium.org, tfarina, tim+watch_chromium.org, zea+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@cleanup_bookmark_client
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Limit access to ChromeBookmarkClient to bookmarks code ChromeBookmarkClient and BookmarkClient are implementation detail of the bookmark component. Their goal is to abstract embedder differences. Thus they should only be used by BookmarkModel. - Change initialization of the two BookmarkPermanentNode managed_node and supervised_node to still be controlled by ChromeBookmarkClient but make the nodes accessible through BookmarkModel. - Move CanSynNode(), CanBeEditedByUser(), IsPermanentNodeVisible() and PreferTouchIcon() to be defined in BookmarkModel as they do not depend on the embedder (the only difference depends on OS_IOS preprocessor macro). - Add a method RecordAction() to BookmarkModel forwarding to the client and remove the client() accessor to prevent external code to access it. - Change all client of ChromeBookmarkClient to instead use BookmarkModel as all the required API are now available on BookmarkModel. BUG=359565, 383583

Patch Set 1 #

Patch Set 2 : Rebase #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+417 lines, -567 lines) Patch
M chrome/browser/android/bookmarks/bookmarks_bridge.h View 2 chunks +0 lines, -2 lines 0 comments Download
M chrome/browser/android/bookmarks/bookmarks_bridge.cc View 8 chunks +16 lines, -18 lines 0 comments Download
M chrome/browser/android/provider/chrome_browser_provider.cc View 6 chunks +10 lines, -19 lines 0 comments Download
M chrome/browser/android/tab_android.cc View 3 chunks +1 line, -5 lines 0 comments Download
M chrome/browser/bookmarks/chrome_bookmark_client.h View 1 4 chunks +8 lines, -35 lines 0 comments Download
M chrome/browser/bookmarks/chrome_bookmark_client.cc View 1 5 chunks +21 lines, -88 lines 0 comments Download
M chrome/browser/bookmarks/chrome_bookmark_client_unittest.cc View 14 chunks +47 lines, -52 lines 0 comments Download
M chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.cc View 6 chunks +6 lines, -12 lines 0 comments Download
M chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_apitest.cc View 3 chunks +1 line, -5 lines 0 comments Download
M chrome/browser/extensions/api/bookmarks/bookmark_api_helpers.h View 2 chunks +3 lines, -6 lines 0 comments Download
M chrome/browser/extensions/api/bookmarks/bookmark_api_helpers.cc View 7 chunks +12 lines, -14 lines 0 comments Download
M chrome/browser/extensions/api/bookmarks/bookmark_api_helpers_unittest.cc View 10 chunks +15 lines, -21 lines 0 comments Download
M chrome/browser/extensions/api/bookmarks/bookmark_apitest.cc View 4 chunks +2 lines, -6 lines 0 comments Download
M chrome/browser/extensions/api/bookmarks/bookmarks_api.h View 3 chunks +0 lines, -6 lines 0 comments Download
M chrome/browser/extensions/api/bookmarks/bookmarks_api.cc View 16 chunks +19 lines, -31 lines 0 comments Download
M chrome/browser/sync/glue/bookmark_change_processor.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/profile_sync_service_bookmark_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/test/integration/bookmarks_helper.cc View 4 chunks +6 lines, -8 lines 0 comments Download
M chrome/browser/ui/bookmarks/bookmark_context_menu_controller.cc View 5 chunks +4 lines, -10 lines 0 comments Download
M chrome/browser/ui/bookmarks/bookmark_drag_drop.cc View 2 chunks +2 lines, -4 lines 0 comments Download
M chrome/browser/ui/bookmarks/bookmark_utils.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h View 2 chunks +0 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm View 9 chunks +9 lines, -13 lines 0 comments Download
M chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm View 3 chunks +5 lines, -9 lines 0 comments Download
M chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.h View 3 chunks +0 lines, -3 lines 0 comments Download
M chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm View 4 chunks +4 lines, -7 lines 0 comments Download
M chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm View 3 chunks +0 lines, -8 lines 0 comments Download
M chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.mm View 2 chunks +2 lines, -5 lines 0 comments Download
M chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm View 2 chunks +2 lines, -6 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_controller.mm View 2 chunks +0 lines, -5 lines 0 comments Download
M chrome/browser/ui/views/bookmarks/bookmark_bar_view.h View 2 chunks +0 lines, -4 lines 0 comments Download
M chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc View 14 chunks +27 lines, -31 lines 0 comments Download
M chrome/browser/ui/views/bookmarks/bookmark_context_menu_unittest.cc View 3 chunks +3 lines, -7 lines 0 comments Download
M chrome/browser/ui/views/bookmarks/bookmark_drag_drop_views.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h View 2 chunks +0 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc View 5 chunks +4 lines, -11 lines 0 comments Download
M components/bookmarks/browser/bookmark_client.h View 3 chunks +11 lines, -20 lines 1 comment Download
M components/bookmarks/browser/bookmark_client.cc View 1 chunk +0 lines, -4 lines 0 comments Download
M components/bookmarks/browser/bookmark_model.h View 4 chunks +41 lines, -5 lines 3 comments Download
M components/bookmarks/browser/bookmark_model.cc View 23 chunks +102 lines, -33 lines 0 comments Download
M components/bookmarks/browser/bookmark_utils.h View 2 chunks +2 lines, -3 lines 0 comments Download
M components/bookmarks/browser/bookmark_utils.cc View 7 chunks +8 lines, -8 lines 0 comments Download
M components/bookmarks/browser/bookmark_utils_unittest.cc View 1 chunk +1 line, -2 lines 0 comments Download
M components/bookmarks/test/test_bookmark_client.h View 1 chunk +6 lines, -5 lines 0 comments Download
M components/bookmarks/test/test_bookmark_client.cc View 2 chunks +7 lines, -22 lines 0 comments Download
M components/enhanced_bookmarks/enhanced_bookmark_utils.cc View 1 chunk +1 line, -1 line 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 6 (1 generated)
sdefresne
Please take a look. Note that this CL depends, in order, on those two other ...
5 years, 6 months ago (2015-06-23 14:04:28 UTC) #2
sdefresne
ping
5 years, 6 months ago (2015-06-23 21:54:29 UTC) #3
sky
https://codereview.chromium.org/1203713002/diff/20001/components/bookmarks/browser/bookmark_client.h File components/bookmarks/browser/bookmark_client.h (right): https://codereview.chromium.org/1203713002/diff/20001/components/bookmarks/browser/bookmark_client.h#newcode72 components/bookmarks/browser/bookmark_client.h:72: // task will be invoked in the Profile's IO ...
5 years, 6 months ago (2015-06-23 22:03:53 UTC) #4
sdefresne
https://codereview.chromium.org/1203713002/diff/20001/components/bookmarks/browser/bookmark_model.h File components/bookmarks/browser/bookmark_model.h (right): https://codereview.chromium.org/1203713002/diff/20001/components/bookmarks/browser/bookmark_model.h#newcode102 components/bookmarks/browser/bookmark_model.h:102: // The top-level managed bookmarks foled defined by an ...
5 years, 6 months ago (2015-06-23 22:13:05 UTC) #5
sky
5 years, 6 months ago (2015-06-24 02:30:36 UTC) #6
As I mentioned, I don't want any of these functions to live on
BookmarkModel. I'm ok with them living in a separate file that is
shared between the necessary pieces, but not a subclass (BookmarkModel
is intended to be subclassed). I'm ok with the helper living in the
comonents directory, but would like it in a separate target that isn't
part of the bookmarks target.

  -Scott

On Tue, Jun 23, 2015 at 3:13 PM,  <sdefresne@chromium.org> wrote:
>
>
https://codereview.chromium.org/1203713002/diff/20001/components/bookmarks/br...
> File components/bookmarks/browser/bookmark_model.h (right):
>
>
https://codereview.chromium.org/1203713002/diff/20001/components/bookmarks/br...
> components/bookmarks/browser/bookmark_model.h:102: // The top-level
> managed bookmarks foled defined by an enterprise policy. This
> On 2015/06/23 at 22:03:53, sky wrote:
>>
>> I don't think these should be here. These are loaded externally and
>
> not part of the core bookmarkmodel.
>
> Were would you recommend putting them? Should I create a new
> ManagedBookmarkModel with just those two and put it into
> //components/bookmarks/manager/? I cannot leave them in
> ChromeBookmarkClient (without causing code duplication) since the client
> will not be shared between //ios/chrome/browser and //chrome/browser.
>
> With my patches they are still created and managed by the embedder
> through the client (this is the purpose of the |callback| parameter to
> HistoryClient::GetLoadExtraNodesCallback => allow the client to set
> |managed_node_| and |supervised_node_|), but accessor are provided
> through the BookmarkModel for convenience.
>
> https://codereview.chromium.org/1203713002/

To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698