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

Side by Side Diff: chrome/browser/ui/views/content_setting_bubble_contents.cc

Issue 8870003: Merge BorderContentsView into BubbleFrameView; simplify. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and merge. Created 9 years 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
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/content_setting_bubble_contents.h" 5 #include "chrome/browser/ui/views/content_setting_bubble_contents.h"
6 6
7 #if defined(TOOLKIT_USES_GTK) 7 #if defined(TOOLKIT_USES_GTK)
8 #include <gdk/gdk.h> 8 #include <gdk/gdk.h>
9 #endif 9 #endif
10 10
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 int preferred_width = 128 int preferred_width =
129 (!content_setting_bubble_model_->bubble_content().domain_lists.empty() && 129 (!content_setting_bubble_model_->bubble_content().domain_lists.empty() &&
130 (kMinMultiLineContentsWidth > preferred_size.width())) ? 130 (kMinMultiLineContentsWidth > preferred_size.width())) ?
131 kMinMultiLineContentsWidth : preferred_size.width(); 131 kMinMultiLineContentsWidth : preferred_size.width();
132 preferred_size.set_width(std::min(preferred_width, kMaxContentsWidth)); 132 preferred_size.set_width(std::min(preferred_width, kMaxContentsWidth));
133 return preferred_size; 133 return preferred_size;
134 } 134 }
135 135
136 gfx::Rect ContentSettingBubbleContents::GetAnchorRect() { 136 gfx::Rect ContentSettingBubbleContents::GetAnchorRect() {
137 gfx::Rect rect(BubbleDelegateView::GetAnchorRect()); 137 gfx::Rect rect(BubbleDelegateView::GetAnchorRect());
138 rect.Offset(0, -5); 138 rect.Inset(0, anchor_view() ? 5 : 0);
139 return rect; 139 return rect;
140 } 140 }
141 141
142 void ContentSettingBubbleContents::Init() { 142 void ContentSettingBubbleContents::Init() {
143 using views::GridLayout; 143 using views::GridLayout;
144 144
145 GridLayout* layout = new views::GridLayout(this); 145 GridLayout* layout = new views::GridLayout(this);
146 SetLayoutManager(layout); 146 SetLayoutManager(layout);
147 147
148 const int single_column_set_id = 0; 148 const int single_column_set_id = 0;
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 } 331 }
332 332
333 void ContentSettingBubbleContents::Observe( 333 void ContentSettingBubbleContents::Observe(
334 int type, 334 int type,
335 const content::NotificationSource& source, 335 const content::NotificationSource& source,
336 const content::NotificationDetails& details) { 336 const content::NotificationDetails& details) {
337 DCHECK(type == content::NOTIFICATION_TAB_CONTENTS_DESTROYED); 337 DCHECK(type == content::NOTIFICATION_TAB_CONTENTS_DESTROYED);
338 DCHECK(source == content::Source<TabContents>(tab_contents_)); 338 DCHECK(source == content::Source<TabContents>(tab_contents_));
339 tab_contents_ = NULL; 339 tab_contents_ = NULL;
340 } 340 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698