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

Side by Side Diff: components/bubble/bubble_controller.cc

Issue 1323133002: Pass a BubbleReference to BubbleUI::Show. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bubbleReference -> bubble_reference Created 5 years, 3 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
« no previous file with comments | « components/bubble/BUILD.gn ('k') | components/bubble/bubble_manager.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/bubble/bubble_controller.h" 5 #include "components/bubble/bubble_controller.h"
6 6
7 #include "components/bubble/bubble_delegate.h" 7 #include "components/bubble/bubble_delegate.h"
8 #include "components/bubble/bubble_manager.h" 8 #include "components/bubble/bubble_manager.h"
9 #include "components/bubble/bubble_ui.h" 9 #include "components/bubble/bubble_ui.h"
10 10
(...skipping 10 matching lines...) Expand all
21 } 21 }
22 22
23 bool BubbleController::CloseBubble(BubbleCloseReason reason) { 23 bool BubbleController::CloseBubble(BubbleCloseReason reason) {
24 return manager_->CloseBubble(this->AsWeakPtr(), reason); 24 return manager_->CloseBubble(this->AsWeakPtr(), reason);
25 } 25 }
26 26
27 void BubbleController::Show() { 27 void BubbleController::Show() {
28 DCHECK(!bubble_ui_); 28 DCHECK(!bubble_ui_);
29 bubble_ui_ = delegate_->BuildBubbleUI(); 29 bubble_ui_ = delegate_->BuildBubbleUI();
30 DCHECK(bubble_ui_); 30 DCHECK(bubble_ui_);
31 bubble_ui_->Show(); 31 bubble_ui_->Show(AsWeakPtr());
32 // TODO(hcarmona): log that bubble was shown. 32 // TODO(hcarmona): log that bubble was shown.
33 } 33 }
34 34
35 void BubbleController::UpdateAnchorPosition() { 35 void BubbleController::UpdateAnchorPosition() {
36 DCHECK(bubble_ui_); 36 DCHECK(bubble_ui_);
37 bubble_ui_->UpdateAnchorPosition(); 37 bubble_ui_->UpdateAnchorPosition();
38 } 38 }
39 39
40 bool BubbleController::ShouldClose(BubbleCloseReason reason) { 40 bool BubbleController::ShouldClose(BubbleCloseReason reason) {
41 DCHECK(bubble_ui_); 41 DCHECK(bubble_ui_);
42 if (delegate_->ShouldClose(reason) || reason == BUBBLE_CLOSE_FORCED) { 42 if (delegate_->ShouldClose(reason) || reason == BUBBLE_CLOSE_FORCED) {
43 bubble_ui_->Close(); 43 bubble_ui_->Close();
44 bubble_ui_.reset(); 44 bubble_ui_.reset();
45 // TODO(hcarmona): log that bubble was hidden. 45 // TODO(hcarmona): log that bubble was hidden.
46 return true; 46 return true;
47 } 47 }
48 return false; 48 return false;
49 } 49 }
OLDNEW
« no previous file with comments | « components/bubble/BUILD.gn ('k') | components/bubble/bubble_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698