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

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

Issue 1572743002: Make sure bubbles in Views default to close before their RenderFrameHosts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Move DCHECK string into longer comment Created 4 years, 10 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/bubble_controller.h ('k') | components/bubble/bubble_delegate.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 <utility> 7 #include <utility>
8 8
9 #include "components/bubble/bubble_delegate.h" 9 #include "components/bubble/bubble_delegate.h"
10 #include "components/bubble/bubble_manager.h" 10 #include "components/bubble/bubble_manager.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 void BubbleController::UpdateAnchorPosition() { 53 void BubbleController::UpdateAnchorPosition() {
54 DCHECK(bubble_ui_); 54 DCHECK(bubble_ui_);
55 bubble_ui_->UpdateAnchorPosition(); 55 bubble_ui_->UpdateAnchorPosition();
56 } 56 }
57 57
58 bool BubbleController::ShouldClose(BubbleCloseReason reason) const { 58 bool BubbleController::ShouldClose(BubbleCloseReason reason) const {
59 DCHECK(bubble_ui_); 59 DCHECK(bubble_ui_);
60 return delegate_->ShouldClose(reason) || reason == BUBBLE_CLOSE_FORCED; 60 return delegate_->ShouldClose(reason) || reason == BUBBLE_CLOSE_FORCED;
61 } 61 }
62 62
63 bool BubbleController::OwningFrameIs(
64 const content::RenderFrameHost* frame) const {
65 DCHECK(bubble_ui_);
66 return delegate_->OwningFrame() == frame;
67 }
68
63 void BubbleController::DoClose() { 69 void BubbleController::DoClose() {
64 DCHECK(bubble_ui_); 70 DCHECK(bubble_ui_);
65 bubble_ui_->Close(); 71 bubble_ui_->Close();
66 bubble_ui_.reset(); 72 bubble_ui_.reset();
67 delegate_->DidClose(); 73 delegate_->DidClose();
68 } 74 }
OLDNEW
« no previous file with comments | « components/bubble/bubble_controller.h ('k') | components/bubble/bubble_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698