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

Issue 7033048: Multi-tab: Adding new Notification when tab selection changes. (Closed)

Created:
9 years, 6 months ago by dpapad
Modified:
9 years, 6 months ago
Reviewers:
sky
CC:
chromium-reviews
Visibility:
Public.

Description

Multi-tab: Adding new Notification when tab selection changes. In this CL 1) TabStripModelObserver::ActiveTabChanged is only called when the active tab actually changes (where as before it was called to also signal tab selection changes). 2) TabStripModelObserver::TabSelectionChanged is called when the tab selection changes. 3) BaseTabStrip::SelectTabAt() is replaced by BaseTabStrip::SetSelection(). BUG=NONE TEST=NONE Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=89752

Patch Set 1 #

Total comments: 10

Patch Set 2 : Addressing comments. #

Total comments: 19

Patch Set 3 : Addressing comments #

Total comments: 8

Patch Set 4 : Renaming BaseTabStrip::SelectTabAt, updating callers #

Total comments: 10

Patch Set 5 : Addressing comments #

Patch Set 6 : Addressing comments, fixing notifications when old_contents no longer exists #

Patch Set 7 : Rebasing #

Total comments: 8

Patch Set 8 : Addressing comments #

Total comments: 4

Patch Set 9 : Fixing so TabStripModelTest.InsertBefore does not hang. #

Patch Set 10 : Adding test coverage for TabStripSelectionModel::Equals, rebasing. #

Patch Set 11 : Rebasing #

Patch Set 12 : Fixing existing unit tests, adding new unit test for multiple selection. #

Total comments: 5

Patch Set 13 : Removing unnecessary argument from MockTabStripModelObserver() calls. #

Total comments: 2

Patch Set 14 : Nit #

Total comments: 1

Patch Set 15 : Addressing comments #

Total comments: 7

Patch Set 16 : Nits #

Patch Set 17 : Fixing windows compile error. #

Patch Set 18 : Fixing most of the unit tests. #

Total comments: 1

Patch Set 19 : Fixing remaining unittests #

Patch Set 20 : Rebasing #

Unified diffs Side-by-side diffs Delta from patch set Stats (+284 lines, -131 lines) Patch
M chrome/browser/aeropeek_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/extensions/extension_browser_event_router.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/tabs/tab_strip_model.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +16 lines, -9 lines 0 comments Download
M chrome/browser/tabs/tab_strip_model.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 8 chunks +59 lines, -53 lines 0 comments Download
M chrome/browser/tabs/tab_strip_model_observer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +14 lines, -11 lines 0 comments Download
M chrome/browser/tabs/tab_strip_model_observer.cc View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/tabs/tab_strip_model_order_controller.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/tabs/tab_strip_model_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 13 chunks +122 lines, -12 lines 0 comments Download
M chrome/browser/tabs/tab_strip_selection_model.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/tabs/tab_strip_selection_model.cc View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/tabs/tab_strip_selection_model_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +17 lines, -0 lines 0 comments Download
M chrome/browser/ui/browser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/gtk/browser_window_gtk.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/ui/touch/frame/touch_browser_frame_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/ui/touch/tabs/touch_tab_strip.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/ui/touch/tabs/touch_tab_strip.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/tabs/base_tab_strip.h View 1 2 3 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/ui/views/tabs/browser_tab_strip_controller.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +4 lines, -7 lines 0 comments Download
M chrome/browser/ui/views/tabs/side_tab_strip.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/ui/views/tabs/side_tab_strip.cc View 1 2 3 2 chunks +6 lines, -5 lines 0 comments Download
M chrome/browser/ui/views/tabs/tab_strip.h View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/ui/views/tabs/tab_strip.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +13 lines, -3 lines 0 comments Download

Messages

Total messages: 39 (0 generated)
dpapad
I have not updated any classes that implement the TabStripModelObsever yet. Doing an ack-grep returned ...
9 years, 6 months ago (2011-06-02 18:40:33 UTC) #1
sky
> I have not updated any classes that implement the > TabStripModelObsever yet. > Doing ...
9 years, 6 months ago (2011-06-02 20:27:58 UTC) #2
dpapad
I tried to update all sites that override ActiveTabChanged. I removed the "old_contents == new_contents" ...
9 years, 6 months ago (2011-06-02 23:29:50 UTC) #3
sky
The one place that wants to know about any selection change is BrowserTabStripController. Change the ...
9 years, 6 months ago (2011-06-03 15:35:56 UTC) #4
dpapad
Changes to SideTabStrip, TabStrip, TouchTabStrip and test coverage for TabStripSelectionModel::Equals will follow (in this CL). ...
9 years, 6 months ago (2011-06-03 17:49:01 UTC) #5
sky
http://codereview.chromium.org/7033048/diff/9001/chrome/browser/tabs/tab_strip_model.cc File chrome/browser/tabs/tab_strip_model.cc (right): http://codereview.chromium.org/7033048/diff/9001/chrome/browser/tabs/tab_strip_model.cc#newcode160 chrome/browser/tabs/tab_strip_model.cc:160: TabInsertedAt(contents, index, active)); On 2011/06/03 17:49:02, dpapad wrote: > ...
9 years, 6 months ago (2011-06-03 18:17:40 UTC) #6
dpapad
http://codereview.chromium.org/7033048/diff/9001/chrome/browser/tabs/tab_strip_model.cc File chrome/browser/tabs/tab_strip_model.cc (right): http://codereview.chromium.org/7033048/diff/9001/chrome/browser/tabs/tab_strip_model.cc#newcode232 chrome/browser/tabs/tab_strip_model.cc:232: NotifyIfActiveOrSelectionChanged(old_model); On 2011/06/03 18:17:40, sky wrote: > On 2011/06/03 ...
9 years, 6 months ago (2011-06-03 18:35:10 UTC) #7
sky
On Fri, Jun 3, 2011 at 11:35 AM, <dpapad@chromium.org> wrote: > > http://codereview.chromium.org/7033048/diff/9001/chrome/browser/tabs/tab_strip_model.cc > File ...
9 years, 6 months ago (2011-06-03 19:00:09 UTC) #8
dpapad
I think that I have included all requested changes. As you see there are 4 ...
9 years, 6 months ago (2011-06-06 16:28:20 UTC) #9
sky
I only looked at TabStripModel. Once you work out the kinks here I'll look at ...
9 years, 6 months ago (2011-06-06 21:01:14 UTC) #10
dpapad
http://codereview.chromium.org/7033048/diff/12001/chrome/browser/tabs/tab_strip_model.cc File chrome/browser/tabs/tab_strip_model.cc (right): http://codereview.chromium.org/7033048/diff/12001/chrome/browser/tabs/tab_strip_model.cc#newcode165 chrome/browser/tabs/tab_strip_model.cc:165: NotifyIfActiveOrSelectionChanged(old_model, false); On 2011/06/06 21:01:14, sky wrote: > Can ...
9 years, 6 months ago (2011-06-06 22:17:11 UTC) #11
sky
http://codereview.chromium.org/7033048/diff/12001/chrome/browser/tabs/tab_strip_model.cc File chrome/browser/tabs/tab_strip_model.cc (right): http://codereview.chromium.org/7033048/diff/12001/chrome/browser/tabs/tab_strip_model.cc#newcode224 chrome/browser/tabs/tab_strip_model.cc:224: old_model.Copy(selection_model_); On 2011/06/06 22:17:11, dpapad wrote: > On 2011/06/06 ...
9 years, 6 months ago (2011-06-06 22:42:16 UTC) #12
dpapad
After the latest changes only TabStripModelTest.MultipleToSingle unit test is failing, it just needs to be ...
9 years, 6 months ago (2011-06-07 20:19:56 UTC) #13
sky
http://codereview.chromium.org/7033048/diff/21001/chrome/browser/tabs/tab_strip_model.cc File chrome/browser/tabs/tab_strip_model.cc (right): http://codereview.chromium.org/7033048/diff/21001/chrome/browser/tabs/tab_strip_model.cc#newcode165 chrome/browser/tabs/tab_strip_model.cc:165: NotifyIfActiveTabChanged(selected_contents, active_index(), false); You always end up invoking both ...
9 years, 6 months ago (2011-06-07 20:32:44 UTC) #14
dpapad
http://codereview.chromium.org/7033048/diff/21001/chrome/browser/tabs/tab_strip_model.cc File chrome/browser/tabs/tab_strip_model.cc (right): http://codereview.chromium.org/7033048/diff/21001/chrome/browser/tabs/tab_strip_model.cc#newcode165 chrome/browser/tabs/tab_strip_model.cc:165: NotifyIfActiveTabChanged(selected_contents, active_index(), false); On 2011/06/07 20:32:44, sky wrote: > ...
9 years, 6 months ago (2011-06-07 23:20:08 UTC) #15
sky
Yay, looks like you're on the right tab. Just add tests and all good. Make ...
9 years, 6 months ago (2011-06-07 23:29:29 UTC) #16
dpapad
I am in the process of fixing/updating existing unit tests. http://codereview.chromium.org/7033048/diff/25025/chrome/browser/tabs/tab_strip_model.cc File chrome/browser/tabs/tab_strip_model.cc (right): http://codereview.chromium.org/7033048/diff/25025/chrome/browser/tabs/tab_strip_model.cc#newcode227 ...
9 years, 6 months ago (2011-06-08 18:22:51 UTC) #17
sky
http://codereview.chromium.org/7033048/diff/25025/chrome/browser/tabs/tab_strip_model.cc File chrome/browser/tabs/tab_strip_model.cc (right): http://codereview.chromium.org/7033048/diff/25025/chrome/browser/tabs/tab_strip_model.cc#newcode227 chrome/browser/tabs/tab_strip_model.cc:227: if (selection_model_.active() == TabStripSelectionModel::kUnselectedIndex) { On 2011/06/08 18:22:51, dpapad ...
9 years, 6 months ago (2011-06-08 19:25:07 UTC) #18
dpapad
I added test coverage for TabStripSelectionModel::Equals. Regarding adding tests for TabSelectionChanged: By looking at tab_strip_model_unittest.cc ...
9 years, 6 months ago (2011-06-09 00:38:29 UTC) #19
sky
On Wed, Jun 8, 2011 at 5:38 PM, <dpapad@chromium.org> wrote: > I added test coverage ...
9 years, 6 months ago (2011-06-09 17:02:56 UTC) #20
dpapad
I fixed all the existing unit tests and also added a new test for multiple ...
9 years, 6 months ago (2011-06-10 17:23:55 UTC) #21
sky
http://codereview.chromium.org/7033048/diff/21029/chrome/browser/tabs/tab_strip_model_unittest.cc File chrome/browser/tabs/tab_strip_model_unittest.cc (right): http://codereview.chromium.org/7033048/diff/21029/chrome/browser/tabs/tab_strip_model_unittest.cc#newcode2251 chrome/browser/tabs/tab_strip_model_unittest.cc:2251: ASSERT_EQ(observer.GetStateAt(4)->action, On 2011/06/10 17:23:55, dpapad wrote: > It seems ...
9 years, 6 months ago (2011-06-10 17:56:04 UTC) #22
dpapad
http://codereview.chromium.org/7033048/diff/21029/chrome/browser/tabs/tab_strip_model_unittest.cc File chrome/browser/tabs/tab_strip_model_unittest.cc (right): http://codereview.chromium.org/7033048/diff/21029/chrome/browser/tabs/tab_strip_model_unittest.cc#newcode2251 chrome/browser/tabs/tab_strip_model_unittest.cc:2251: ASSERT_EQ(observer.GetStateAt(4)->action, On 2011/06/10 17:56:04, sky wrote: > On 2011/06/10 ...
9 years, 6 months ago (2011-06-10 18:21:37 UTC) #23
sky
http://codereview.chromium.org/7033048/diff/21029/chrome/browser/tabs/tab_strip_model_unittest.cc File chrome/browser/tabs/tab_strip_model_unittest.cc (right): http://codereview.chromium.org/7033048/diff/21029/chrome/browser/tabs/tab_strip_model_unittest.cc#newcode2251 chrome/browser/tabs/tab_strip_model_unittest.cc:2251: ASSERT_EQ(observer.GetStateAt(4)->action, On 2011/06/10 18:21:37, dpapad wrote: > On 2011/06/10 ...
9 years, 6 months ago (2011-06-10 19:25:24 UTC) #24
dpapad
http://codereview.chromium.org/7033048/diff/21029/chrome/browser/tabs/tab_strip_model_unittest.cc File chrome/browser/tabs/tab_strip_model_unittest.cc (right): http://codereview.chromium.org/7033048/diff/21029/chrome/browser/tabs/tab_strip_model_unittest.cc#newcode2251 chrome/browser/tabs/tab_strip_model_unittest.cc:2251: ASSERT_EQ(observer.GetStateAt(4)->action, On 2011/06/10 19:25:24, sky wrote: > On 2011/06/10 ...
9 years, 6 months ago (2011-06-13 21:36:18 UTC) #25
sky
LGTM http://codereview.chromium.org/7033048/diff/19061/chrome/browser/tabs/tab_strip_model.cc File chrome/browser/tabs/tab_strip_model.cc (right): http://codereview.chromium.org/7033048/diff/19061/chrome/browser/tabs/tab_strip_model.cc#newcode242 chrome/browser/tabs/tab_strip_model.cc:242: if (was_selected) { It's pretty subtle as to ...
9 years, 6 months ago (2011-06-13 22:20:16 UTC) #26
dpapad
I am getting a huge amount of browser_tests failing on Windows. Could you please take ...
9 years, 6 months ago (2011-06-14 16:58:23 UTC) #27
sky
On Tue, Jun 14, 2011 at 9:58 AM, <dpapad@chromium.org> wrote: > I am getting a ...
9 years, 6 months ago (2011-06-14 17:22:19 UTC) #28
dpapad
On 2011/06/14 17:22:19, sky wrote: > On Tue, Jun 14, 2011 at 9:58 AM, <mailto:dpapad@chromium.org> ...
9 years, 6 months ago (2011-06-14 18:45:27 UTC) #29
sky
It could just be that bot. I would do another try in hopes you get ...
9 years, 6 months ago (2011-06-14 20:56:38 UTC) #30
dpapad
I tried to debug the windows failing tests with no success. There seemed to be ...
9 years, 6 months ago (2011-06-16 00:09:07 UTC) #31
sky
Did you run only the failing test and with --single-process? Without the changes to views ...
9 years, 6 months ago (2011-06-16 01:06:30 UTC) #32
dpapad
On 2011/06/16 01:06:30, sky wrote: > Did you run only the failing test and with ...
9 years, 6 months ago (2011-06-16 13:12:37 UTC) #33
sky
Glad to hear it! Let me know when you want me to take another look. ...
9 years, 6 months ago (2011-06-16 16:19:59 UTC) #34
dpapad
I am still trying to debug the remaining two unit tests that fail. http://codereview.chromium.org/7033048/diff/47001/chrome/browser/ui/views/tabs/tab_strip.cc File ...
9 years, 6 months ago (2011-06-17 19:55:23 UTC) #35
sky
On Fri, Jun 17, 2011 at 12:55 PM, <dpapad@chromium.org> wrote: > I am still trying ...
9 years, 6 months ago (2011-06-17 22:18:42 UTC) #36
dpapad
I think I have found the cause of the remaining two failing unit tests (SessionRestoreTest.RestoreIndividualTabFromWindow ...
9 years, 6 months ago (2011-06-17 22:49:01 UTC) #37
dpapad
On 2011/06/17 22:49:01, dpapad wrote: > I think I have found the cause of the ...
9 years, 6 months ago (2011-06-20 17:51:55 UTC) #38
sky
9 years, 6 months ago (2011-06-20 18:19:32 UTC) #39
YAY! Land away.

  -Scott

On Mon, Jun 20, 2011 at 10:51 AM,  <dpapad@chromium.org> wrote:
> On 2011/06/17 22:49:01, dpapad wrote:
>>
>> I think I have found the cause of the remaining two failing unit tests
>> (SessionRestoreTest.RestoreIndividualTabFromWindow and
>> SessionRestoreTest.WindowWithOneTab).
>
>> BaseTabStrip::ModelIndexToTabIndex() is returning tab_data_.size()
>
> (sometimes).
>>
>> The returned value is being used to index |tab_data_| in tab_strip.cc:253
>> (in
>> this CL) and this results in "vector subscript out of range" error (line
>> 764
>
> in
>>
>> <vector>). Can you help resolve this issue? I could send you a stack trace
>> if
>
> it
>>
>> would help.
>
> It seems that all unit tests are fixed, finally. I will try to land this
> today,
> is that ok?
>
> http://codereview.chromium.org/7033048/
>

Powered by Google App Engine
This is Rietveld 408576698