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

Side by Side Diff: chrome/browser/views/toolbar_view.cc

Issue 276033: [chromium-reviews] Fix bug: browser action button disappears when loading a new extension. This ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/views/toolbar_view.h" 5 #include "chrome/browser/views/toolbar_view.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "app/drag_drop_types.h" 9 #include "app/drag_drop_types.h"
10 #include "app/gfx/canvas.h" 10 #include "app/gfx/canvas.h"
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 } 545 }
546 location_bar_->SetBounds(location_x, child_y, std::max(available_width, 0), 546 location_bar_->SetBounds(location_x, child_y, std::max(available_width, 0),
547 child_height); 547 child_height);
548 548
549 go_->SetBounds(location_bar_->x() + location_bar_->width(), child_y, 549 go_->SetBounds(location_bar_->x() + location_bar_->width(), child_y,
550 go_button_width, child_height); 550 go_button_width, child_height);
551 551
552 int next_menu_x = go_->x() + go_->width() + kMenuButtonOffset; 552 int next_menu_x = go_->x() + go_->width() + kMenuButtonOffset;
553 553
554 browser_actions_->SetBounds(next_menu_x, 0, browser_actions_width, height()); 554 browser_actions_->SetBounds(next_menu_x, 0, browser_actions_width, height());
555
556 // The browser action needs to do a layout explicitly, because when an
557 // extension is loaded/unloaded/changed, BrowserActionContainer removes and
558 // re-adds everything, regardless of whether it has a page action. For a
559 // page action, browser action bounds do not change, as a result of which
560 // SetBounds does not do a layout at all.
561 // TODO(sidchat): Rework the above bahavior so that explicit layout is not
562 // required.
563 browser_actions_->Layout();
564
555 next_menu_x += browser_actions_width; 565 next_menu_x += browser_actions_width;
556 566
557 if (bookmark_menu_) { 567 if (bookmark_menu_) {
558 bookmark_menu_->SetBounds(next_menu_x, child_y, bookmark_menu_width, 568 bookmark_menu_->SetBounds(next_menu_x, child_y, bookmark_menu_width,
559 child_height); 569 child_height);
560 next_menu_x += bookmark_menu_width; 570 next_menu_x += bookmark_menu_width;
561 } 571 }
562 572
563 page_menu_->SetBounds(next_menu_x, child_y, page_menu_width, child_height); 573 page_menu_->SetBounds(next_menu_x, child_y, page_menu_width, child_height);
564 next_menu_x += page_menu_width; 574 next_menu_x += page_menu_width;
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
1151 app_menu_contents_->AddItem(IDC_ABOUT, 1161 app_menu_contents_->AddItem(IDC_ABOUT,
1152 l10n_util::GetStringFUTF16( 1162 l10n_util::GetStringFUTF16(
1153 IDS_ABOUT, 1163 IDS_ABOUT,
1154 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); 1164 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
1155 app_menu_contents_->AddItemWithStringId(IDC_HELP_PAGE, IDS_HELP_PAGE); 1165 app_menu_contents_->AddItemWithStringId(IDC_HELP_PAGE, IDS_HELP_PAGE);
1156 app_menu_contents_->AddSeparator(); 1166 app_menu_contents_->AddSeparator();
1157 app_menu_contents_->AddItemWithStringId(IDC_EXIT, IDS_EXIT); 1167 app_menu_contents_->AddItemWithStringId(IDC_EXIT, IDS_EXIT);
1158 1168
1159 app_menu_menu_.reset(new views::Menu2(app_menu_contents_.get())); 1169 app_menu_menu_.reset(new views::Menu2(app_menu_contents_.get()));
1160 } 1170 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698