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

Side by Side Diff: chrome/browser/ui/browser.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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after
1422 if (devtools_window) 1422 if (devtools_window)
1423 devtools_window->ShowCertificateViewer(cert_id); 1423 devtools_window->ShowCertificateViewer(cert_id);
1424 } 1424 }
1425 1425
1426 scoped_ptr<content::BluetoothChooser> Browser::RunBluetoothChooser( 1426 scoped_ptr<content::BluetoothChooser> Browser::RunBluetoothChooser(
1427 content::WebContents* web_contents, 1427 content::WebContents* web_contents,
1428 const content::BluetoothChooser::EventHandler& event_handler, 1428 const content::BluetoothChooser::EventHandler& event_handler,
1429 const url::Origin& origin) { 1429 const url::Origin& origin) {
1430 scoped_ptr<BluetoothChooserDesktop> bluetooth_chooser_desktop( 1430 scoped_ptr<BluetoothChooserDesktop> bluetooth_chooser_desktop(
1431 new BluetoothChooserDesktop(event_handler)); 1431 new BluetoothChooserDesktop(event_handler));
1432 Browser* browser = chrome::FindBrowserWithWebContents(web_contents);
1433 scoped_ptr<BluetoothChooserBubbleDelegate> bubble_delegate( 1432 scoped_ptr<BluetoothChooserBubbleDelegate> bubble_delegate(
1434 new BluetoothChooserBubbleDelegate(browser)); 1433 new BluetoothChooserBubbleDelegate(web_contents->GetMainFrame()));
1435 BluetoothChooserBubbleDelegate* bubble_delegate_ptr = bubble_delegate.get(); 1434 BluetoothChooserBubbleDelegate* bubble_delegate_ptr = bubble_delegate.get();
1436 1435
1437 // Wire the ChooserBubbleDelegate to the BluetoothChooser. 1436 // Wire the ChooserBubbleDelegate to the BluetoothChooser.
1438 bluetooth_chooser_desktop->set_bluetooth_chooser_bubble_delegate( 1437 bluetooth_chooser_desktop->set_bluetooth_chooser_bubble_delegate(
1439 bubble_delegate_ptr); 1438 bubble_delegate_ptr);
1440 bubble_delegate->set_bluetooth_chooser(bluetooth_chooser_desktop.get()); 1439 bubble_delegate->set_bluetooth_chooser(bluetooth_chooser_desktop.get());
1441 1440
1441 Browser* browser = chrome::FindBrowserWithWebContents(web_contents);
1442 BubbleReference bubble_controller = 1442 BubbleReference bubble_controller =
1443 browser->GetBubbleManager()->ShowBubble(std::move(bubble_delegate)); 1443 browser->GetBubbleManager()->ShowBubble(std::move(bubble_delegate));
1444 bubble_delegate_ptr->set_bubble_controller(bubble_controller); 1444 bubble_delegate_ptr->set_bubble_controller(bubble_controller);
1445 1445
1446 return std::move(bluetooth_chooser_desktop); 1446 return std::move(bluetooth_chooser_desktop);
1447 } 1447 }
1448 1448
1449 bool Browser::RequestAppBanner(content::WebContents* web_contents) { 1449 bool Browser::RequestAppBanner(content::WebContents* web_contents) {
1450 banners::AppBannerManagerDesktop* manager = 1450 banners::AppBannerManagerDesktop* manager =
1451 banners::AppBannerManagerDesktop::FromWebContents(web_contents); 1451 banners::AppBannerManagerDesktop::FromWebContents(web_contents);
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after
2739 if (contents && !allow_js_access) { 2739 if (contents && !allow_js_access) {
2740 contents->web_contents()->GetController().LoadURL( 2740 contents->web_contents()->GetController().LoadURL(
2741 target_url, 2741 target_url,
2742 content::Referrer(), 2742 content::Referrer(),
2743 ui::PAGE_TRANSITION_LINK, 2743 ui::PAGE_TRANSITION_LINK,
2744 std::string()); // No extra headers. 2744 std::string()); // No extra headers.
2745 } 2745 }
2746 2746
2747 return contents != NULL; 2747 return contents != NULL;
2748 } 2748 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/bluetooth/bluetooth_chooser_bubble_delegate.cc ('k') | chrome/browser/ui/chrome_bubble_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698