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

Side by Side Diff: chrome/browser/ui/views/infobars/extension_infobar.cc

Issue 7237025: Updating Extension infobars to account for changes... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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 | « chrome/browser/resources/extensions_infobar.css ('k') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ui/views/infobars/extension_infobar.h" 5 #include "chrome/browser/ui/views/infobars/extension_infobar.h"
6 6
7 #include "chrome/browser/extensions/extension_context_menu_model.h" 7 #include "chrome/browser/extensions/extension_context_menu_model.h"
8 #include "chrome/browser/extensions/extension_host.h" 8 #include "chrome/browser/extensions/extension_host.h"
9 #include "chrome/browser/extensions/extension_infobar_delegate.h" 9 #include "chrome/browser/extensions/extension_infobar_delegate.h"
10 #include "chrome/browser/platform_util.h" 10 #include "chrome/browser/platform_util.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 59 }
60 60
61 void ExtensionInfoBar::Layout() { 61 void ExtensionInfoBar::Layout() {
62 InfoBarView::Layout(); 62 InfoBarView::Layout();
63 63
64 gfx::Size menu_size = menu_->GetPreferredSize(); 64 gfx::Size menu_size = menu_->GetPreferredSize();
65 menu_->SetBounds(StartX(), OffsetY(menu_size), menu_size.width(), 65 menu_->SetBounds(StartX(), OffsetY(menu_size), menu_size.width(),
66 menu_size.height()); 66 menu_size.height());
67 67
68 GetDelegate()->extension_host()->view()->SetBounds( 68 GetDelegate()->extension_host()->view()->SetBounds(
69 menu_->bounds().right() + kMenuHorizontalMargin, 0, 69 menu_->bounds().right() + kMenuHorizontalMargin,
70 std::max(0, EndX() - StartX() - ContentMinimumWidth()), height()); 70 arrow_height(),
71 std::max(0, EndX() - StartX() - ContentMinimumWidth()),
72 height() - arrow_height() - 1);
71 } 73 }
72 74
73 void ExtensionInfoBar::ViewHierarchyChanged(bool is_add, 75 void ExtensionInfoBar::ViewHierarchyChanged(bool is_add,
74 View* parent, 76 View* parent,
75 View* child) { 77 View* child) {
76 if (!is_add || (child != this) || (menu_ != NULL)) { 78 if (!is_add || (child != this) || (menu_ != NULL)) {
77 InfoBarView::ViewHierarchyChanged(is_add, parent, child); 79 InfoBarView::ViewHierarchyChanged(is_add, parent, child);
78 return; 80 return;
79 } 81 }
80 82
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 gfx::Point screen_point; 191 gfx::Point screen_point;
190 views::View::ConvertPointToScreen(menu_, &screen_point); 192 views::View::ConvertPointToScreen(menu_, &screen_point);
191 options_menu.RunMenuAt(GetWidget()->GetNativeWindow(), menu_, 193 options_menu.RunMenuAt(GetWidget()->GetNativeWindow(), menu_,
192 gfx::Rect(screen_point, menu_->size()), views::MenuItemView::TOPLEFT, 194 gfx::Rect(screen_point, menu_->size()), views::MenuItemView::TOPLEFT,
193 true); 195 true);
194 } 196 }
195 197
196 ExtensionInfoBarDelegate* ExtensionInfoBar::GetDelegate() { 198 ExtensionInfoBarDelegate* ExtensionInfoBar::GetDelegate() {
197 return delegate_ ? delegate_->AsExtensionInfoBarDelegate() : NULL; 199 return delegate_ ? delegate_->AsExtensionInfoBarDelegate() : NULL;
198 } 200 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/extensions_infobar.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698