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

Issue 1152613003: Implement sidebar support for extension action popups (Closed)

Created:
5 years, 7 months ago by ltilve
Modified:
5 years, 5 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, tfarina, extensions-reviews_chromium.org, ben6
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement sidebar support for extension action popups Patch generated from previous existing code provided for issue crbug.com/51084 "Add sidebar surface for extensions". BUG=477424

Patch Set 1 #

Patch Set 2 : #

Total comments: 2

Patch Set 3 : Move SidebarManager to ExtensionSystem and remove notifications #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+1565 lines, -34 lines) Patch
M chrome/browser/extensions/api/developer_private/inspectable_views_finder.cc View 2 chunks +5 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_action.h View 2 chunks +9 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_action.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/extension_system_impl.h View 1 2 3 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_system_impl.cc View 1 2 2 chunks +12 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_view_host.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_view_host_factory.h View 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_view_host_factory.cc View 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/browser/extensions/sidebar_container.h View 1 2 1 chunk +86 lines, -0 lines 0 comments Download
A chrome/browser/extensions/sidebar_container.cc View 1 2 1 chunk +73 lines, -0 lines 0 comments Download
A chrome/browser/extensions/sidebar_manager.h View 1 2 1 chunk +149 lines, -0 lines 1 comment Download
A chrome/browser/extensions/sidebar_manager.cc View 1 2 1 chunk +317 lines, -0 lines 3 comments Download
A chrome/browser/extensions/sidebar_manager_observer.h View 1 2 1 chunk +29 lines, -0 lines 0 comments Download
M chrome/browser/ui/browser.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/browser.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/browser_ui_prefs.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_cocoa.h View 1 2 4 chunks +10 lines, -1 line 0 comments Download
M chrome/browser/ui/cocoa/browser_window_cocoa.mm View 1 2 5 chunks +24 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_controller.h View 3 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_controller.mm View 1 2 5 chunks +19 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_controller_unittest.mm View 1 chunk +4 lines, -0 lines 0 comments Download
A chrome/browser/ui/cocoa/sidebar_controller.h View 1 2 1 chunk +49 lines, -0 lines 0 comments Download
A chrome/browser/ui/cocoa/sidebar_controller.mm View 1 2 1 chunk +210 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/view_id_util_browsertest.mm View 1 2 4 chunks +20 lines, -7 lines 0 comments Download
M chrome/browser/ui/extensions/extension_action_view_controller.h View 1 2 4 chunks +15 lines, -0 lines 0 comments Download
M chrome/browser/ui/extensions/extension_action_view_controller.cc View 1 2 6 chunks +104 lines, -2 lines 0 comments Download
M chrome/browser/ui/view_ids.h View 2 chunks +9 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.h View 1 2 9 chunks +20 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 1 2 11 chunks +121 lines, -12 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view_layout.cc View 3 chunks +12 lines, -0 lines 0 comments Download
A chrome/browser/ui/views/sidebar/sidebar_browsertest.cc View 1 2 1 chunk +187 lines, -0 lines 0 comments Download
M chrome/chrome_browser_extensions.gypi View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/chrome_browser_ui.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/api/developer_private.idl View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/api/extension_action/action_info.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/api/extension_action/action_info.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/common/pref_names.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/pref_names.cc View 1 chunk +2 lines, -0 lines 0 comments Download
D chrome/test/data/extensions/manifest_tests/sidebar.json View 0 chunks +-1 lines, --1 lines 0 comments Download
A chrome/test/data/sidebar/manifest.json View 1 chunk +6 lines, -0 lines 0 comments Download
A + chrome/test/data/sidebar/simple_page.html View 1 chunk +0 lines, -2 lines 0 comments Download
M extensions/browser/extension_host.h View 1 chunk +3 lines, -0 lines 0 comments Download
M extensions/browser/extension_host.cc View 2 chunks +8 lines, -2 lines 0 comments Download
M extensions/browser/extension_system.h View 1 2 2 chunks +3 lines, -0 lines 0 comments Download
M extensions/browser/extension_system.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M extensions/browser/process_manager.cc View 1 chunk +1 line, -0 lines 0 comments Download
M extensions/common/manifest_constants.h View 1 chunk +1 line, -0 lines 0 comments Download
M extensions/common/manifest_constants.cc View 1 chunk +1 line, -0 lines 0 comments Download
M extensions/common/view_type.h View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 16 (3 generated)
ltilve
This patch adds an initial sidebar implementation to allow extensions to show contents on a ...
5 years, 6 months ago (2015-05-27 06:46:15 UTC) #2
not at google - send to devlin
Awesome to see this happening! Devlin will be the primary reviewer for the Sidebar API. ...
5 years, 6 months ago (2015-05-27 15:50:10 UTC) #4
Devlin
Hey, great to see this is coming along! It's gonna take me awhile to make ...
5 years, 6 months ago (2015-05-27 16:51:05 UTC) #5
ltilve
> Hey, great to see this is coming along! Thanks for the comments, we are ...
5 years, 6 months ago (2015-05-27 19:13:17 UTC) #6
not at google - send to devlin
Drive-by thought: should the sidebar implementation be a component?
5 years, 6 months ago (2015-05-27 19:40:04 UTC) #8
ltilve
On 2015/05/27 19:40:04, kalman wrote: > Drive-by thought: should the sidebar implementation be a component? ...
5 years, 6 months ago (2015-05-28 14:03:59 UTC) #9
Devlin
On 2015/05/28 14:03:59, ltilve wrote: > On 2015/05/27 19:40:04, kalman wrote: > > Drive-by thought: ...
5 years, 6 months ago (2015-05-28 15:33:54 UTC) #10
not at google - send to devlin
On 2015/05/28 15:33:54, Devlin wrote: > On 2015/05/28 14:03:59, ltilve wrote: > > On 2015/05/27 ...
5 years, 6 months ago (2015-05-28 15:54:40 UTC) #11
Devlin
A few more notes on this: - If there is a significant amount of code ...
5 years, 6 months ago (2015-06-01 22:08:24 UTC) #12
ltilve
On 2015/05/27 16:51:05, Devlin wrote: > We almost certainly don't want to have a SidebarManager ...
5 years, 6 months ago (2015-06-03 22:25:44 UTC) #13
ltilve
> - If there is a significant amount of code that isn't tied closely to ...
5 years, 6 months ago (2015-06-03 22:51:02 UTC) #14
Devlin
A few more high-level comments. Also, this is still a pretty epicly-sized CL. I think ...
5 years, 6 months ago (2015-06-04 18:00:15 UTC) #15
ltilve
5 years, 6 months ago (2015-06-09 13:04:56 UTC) #16
On 2015/06/04 18:00:15, Devlin wrote:

> A few more high-level comments.  Also, this is still a pretty epicly-sized CL.

> I think we should split it up into (at least) 3.  The first one should include
> no "real" UI code - that is, it shouldn't have anything touched in ui/views or
> ui/cocoa, and you can probably leave out a little of the stuff in, e.g.,
> ui/browser.  The second should add the views implementation, and the third
> should add the cocoa implementation.

Thanks for the comments, I have split the CL into the parts that you suggested
(including the reviewed modifications):
https://codereview.chromium.org/1168383002/
https://codereview.chromium.org/1169823005/
https://codereview.chromium.org/1171873003/

We were aware that was a very big CL, but as it was not feasible separating it
into smaller functional parts, and it was now all working already, we were
thinking that reviewing/testing all together could be fine. But I agree that
making it smaller even though it would not "work" separately, makes sense.

>
https://codereview.chromium.org/1152613003/diff/40001/chrome/browser/extensio...
> File chrome/browser/extensions/sidebar_manager.cc (right):
> 
>
https://codereview.chromium.org/1152613003/diff/40001/chrome/browser/extensio...
> chrome/browser/extensions/sidebar_manager.cc:27:
ContentIdToSidebarContainerMap
> content_id_to_sidebar_container;
> I don't think we should support multiple sidebars in a single tab - it's
> wasteful with web contents, and this "active/inactive" stuff complicates the
> code a lot.  Why not just have it behave similar to popups (though on a
per-tab
> basis) - you can have one sidebar open at a time, and if you open another, it
> closes the first (completely)?

We managed to simplify the code keeping the behaviour, in order to allow two
extensions being able to have their sidebar open in different tabs. 

There would be other reason, if opening a sidebar destroys any other one on a
different tab. Per attribution reasons, we are only showing depressed the
extension action button when its sidebar is visible at the current tab. Because
of this, the user is on a tab without any sidebar, he would not have information
about if clicking on the extension, this could be closing a sidebar on a
different tab, which might have been intended to be more persistent.

>
https://codereview.chromium.org/1152613003/diff/40001/chrome/browser/extensio...
> chrome/browser/extensions/sidebar_manager.cc:96: was_active_sidebar_contents
==
> NULL
> nit (cl-wide): Prefer nullptr over NULL now.

Done.

>
https://codereview.chromium.org/1152613003/diff/40001/chrome/browser/extensio...
> File chrome/browser/extensions/sidebar_manager.h (right):
> 
>
https://codereview.chromium.org/1152613003/diff/40001/chrome/browser/extensio...
> chrome/browser/extensions/sidebar_manager.h:35: public
> base::RefCounted<SidebarManager> {
> Is there a reason this is refcounted?

Changed.

With the new smaller patches I assume we could close this one and use the split
CLs to have smaller deltas to keep on with the review. Is this ok?

Powered by Google App Engine
This is Rietveld 408576698