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

Side by Side Diff: chrome/browser/ui/views/autofill/generated_credit_card_bubble_views.cc

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 years, 7 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/autofill/generated_credit_card_bubble_views.h" 5 #include "chrome/browser/ui/views/autofill/generated_credit_card_bubble_views.h"
6 6
7 #include "chrome/browser/ui/autofill/generated_credit_card_bubble_controller.h" 7 #include "chrome/browser/ui/autofill/generated_credit_card_bubble_controller.h"
8 #include "chrome/browser/ui/browser_finder.h" 8 #include "chrome/browser/ui/browser_finder.h"
9 #include "chrome/browser/ui/views/frame/browser_view.h" 9 #include "chrome/browser/ui/views/frame/browser_view.h"
10 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 10 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } 42 }
43 43
44 void GeneratedCreditCardBubbleViews::Hide() { 44 void GeneratedCreditCardBubbleViews::Hide() {
45 GetWidget()->Close(); 45 GetWidget()->Close();
46 } 46 }
47 47
48 bool GeneratedCreditCardBubbleViews::IsHiding() const { 48 bool GeneratedCreditCardBubbleViews::IsHiding() const {
49 return GetWidget() && GetWidget()->IsClosed(); 49 return GetWidget() && GetWidget()->IsClosed();
50 } 50 }
51 51
52 gfx::Size GeneratedCreditCardBubbleViews::GetPreferredSize() { 52 gfx::Size GeneratedCreditCardBubbleViews::GetPreferredSize() const {
53 return gfx::Size( 53 return gfx::Size(
54 GeneratedCreditCardBubbleView::kContentsWidth, 54 GeneratedCreditCardBubbleView::kContentsWidth,
55 GetHeightForWidth(GeneratedCreditCardBubbleViews::kContentsWidth)); 55 GetHeightForWidth(GeneratedCreditCardBubbleViews::kContentsWidth));
56 } 56 }
57 57
58 base::string16 GeneratedCreditCardBubbleViews::GetWindowTitle() const { 58 base::string16 GeneratedCreditCardBubbleViews::GetWindowTitle() const {
59 return controller_ ? controller_->TitleText() : base::string16(); 59 return controller_ ? controller_->TitleText() : base::string16();
60 } 60 }
61 61
62 void GeneratedCreditCardBubbleViews::Init() { 62 void GeneratedCreditCardBubbleViews::Init() {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 GeneratedCreditCardBubbleViews::GeneratedCreditCardBubbleViews( 98 GeneratedCreditCardBubbleViews::GeneratedCreditCardBubbleViews(
99 const base::WeakPtr<GeneratedCreditCardBubbleController>& controller) 99 const base::WeakPtr<GeneratedCreditCardBubbleController>& controller)
100 : BubbleDelegateView(GetAnchor(controller), views::BubbleBorder::TOP_RIGHT), 100 : BubbleDelegateView(GetAnchor(controller), views::BubbleBorder::TOP_RIGHT),
101 controller_(controller), 101 controller_(controller),
102 weak_ptr_factory_(this) { 102 weak_ptr_factory_(this) {
103 gfx::Insets insets = views::BubbleFrameView::GetTitleInsets(); 103 gfx::Insets insets = views::BubbleFrameView::GetTitleInsets();
104 set_margins(gfx::Insets(0, insets.left(), insets.top(), insets.left())); 104 set_margins(gfx::Insets(0, insets.left(), insets.top(), insets.left()));
105 } 105 }
106 106
107 } // namespace autofill 107 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/autofill/generated_credit_card_bubble_views.h ('k') | chrome/browser/ui/views/autofill/info_bubble.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698