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

Side by Side Diff: ash/shelf/shelf_tooltip_manager.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
« no previous file with comments | « ash/shelf/overflow_bubble_view.cc ('k') | ash/shelf/shelf_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ash/shelf/shelf_tooltip_manager.h" 5 #include "ash/shelf/shelf_tooltip_manager.h"
6 6
7 #include "ash/shelf/shelf_layout_manager.h" 7 #include "ash/shelf/shelf_layout_manager.h"
8 #include "ash/shelf/shelf_view.h" 8 #include "ash/shelf/shelf_view.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 ShelfTooltipManager* host); 53 ShelfTooltipManager* host);
54 54
55 void SetText(const base::string16& text); 55 void SetText(const base::string16& text);
56 void Close(); 56 void Close();
57 57
58 private: 58 private:
59 // views::WidgetDelegate overrides: 59 // views::WidgetDelegate overrides:
60 virtual void WindowClosing() OVERRIDE; 60 virtual void WindowClosing() OVERRIDE;
61 61
62 // views::View overrides: 62 // views::View overrides:
63 virtual gfx::Size GetPreferredSize() OVERRIDE; 63 virtual gfx::Size GetPreferredSize() const OVERRIDE;
64 64
65 ShelfTooltipManager* host_; 65 ShelfTooltipManager* host_;
66 views::Label* label_; 66 views::Label* label_;
67 67
68 DISALLOW_COPY_AND_ASSIGN(ShelfTooltipBubble); 68 DISALLOW_COPY_AND_ASSIGN(ShelfTooltipBubble);
69 }; 69 };
70 70
71 ShelfTooltipManager::ShelfTooltipBubble::ShelfTooltipBubble( 71 ShelfTooltipManager::ShelfTooltipBubble::ShelfTooltipBubble(
72 views::View* anchor, 72 views::View* anchor,
73 views::BubbleBorder::Arrow arrow, 73 views::BubbleBorder::Arrow arrow,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 GetWidget()->Close(); 117 GetWidget()->Close();
118 } 118 }
119 } 119 }
120 120
121 void ShelfTooltipManager::ShelfTooltipBubble::WindowClosing() { 121 void ShelfTooltipManager::ShelfTooltipBubble::WindowClosing() {
122 views::BubbleDelegateView::WindowClosing(); 122 views::BubbleDelegateView::WindowClosing();
123 if (host_) 123 if (host_)
124 host_->OnBubbleClosed(this); 124 host_->OnBubbleClosed(this);
125 } 125 }
126 126
127 gfx::Size ShelfTooltipManager::ShelfTooltipBubble::GetPreferredSize() { 127 gfx::Size ShelfTooltipManager::ShelfTooltipBubble::GetPreferredSize() const {
128 gfx::Size pref_size = views::BubbleDelegateView::GetPreferredSize(); 128 gfx::Size pref_size = views::BubbleDelegateView::GetPreferredSize();
129 if (pref_size.height() < kTooltipMinHeight) 129 if (pref_size.height() < kTooltipMinHeight)
130 pref_size.set_height(kTooltipMinHeight); 130 pref_size.set_height(kTooltipMinHeight);
131 if (pref_size.width() > kTooltipMaxWidth) 131 if (pref_size.width() > kTooltipMaxWidth)
132 pref_size.set_width(kTooltipMaxWidth); 132 pref_size.set_width(kTooltipMaxWidth);
133 return pref_size; 133 return pref_size;
134 } 134 }
135 135
136 ShelfTooltipManager::ShelfTooltipManager( 136 ShelfTooltipManager::ShelfTooltipManager(
137 ShelfLayoutManager* shelf_layout_manager, 137 ShelfLayoutManager* shelf_layout_manager,
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 base::OneShotTimer<ShelfTooltipManager>* new_timer = 366 base::OneShotTimer<ShelfTooltipManager>* new_timer =
367 new base::OneShotTimer<ShelfTooltipManager>(); 367 new base::OneShotTimer<ShelfTooltipManager>();
368 new_timer->Start(FROM_HERE, 368 new_timer->Start(FROM_HERE,
369 base::TimeDelta::FromMilliseconds(delay_in_ms), 369 base::TimeDelta::FromMilliseconds(delay_in_ms),
370 this, 370 this,
371 &ShelfTooltipManager::ShowInternal); 371 &ShelfTooltipManager::ShowInternal);
372 timer_.reset(new_timer); 372 timer_.reset(new_timer);
373 } 373 }
374 374
375 } // namespace ash 375 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/overflow_bubble_view.cc ('k') | ash/shelf/shelf_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698