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

Side by Side Diff: chrome/browser/ui/views/settings_api_bubble_helper_views.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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/settings_api_bubble_helper_views.h" 5 #include "chrome/browser/ui/views/settings_api_bubble_helper_views.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/extensions/ntp_overridden_bubble_delegate.h" 10 #include "chrome/browser/extensions/ntp_overridden_bubble_delegate.h"
(...skipping 12 matching lines...) Expand all
23 #include "content/public/browser/navigation_entry.h" 23 #include "content/public/browser/navigation_entry.h"
24 24
25 namespace extensions { 25 namespace extensions {
26 26
27 namespace { 27 namespace {
28 28
29 void ShowSettingsApiBubble(SettingsApiOverrideType type, 29 void ShowSettingsApiBubble(SettingsApiOverrideType type,
30 Browser* browser, 30 Browser* browser,
31 views::View* anchor_view, 31 views::View* anchor_view,
32 views::BubbleBorder::Arrow arrow) { 32 views::BubbleBorder::Arrow arrow) {
33 scoped_ptr<ExtensionMessageBubbleController> settings_api_bubble( 33 std::unique_ptr<ExtensionMessageBubbleController> settings_api_bubble(
34 new ExtensionMessageBubbleController( 34 new ExtensionMessageBubbleController(
35 new SettingsApiBubbleDelegate(browser->profile(), type), browser)); 35 new SettingsApiBubbleDelegate(browser->profile(), type), browser));
36 if (!settings_api_bubble->ShouldShow()) 36 if (!settings_api_bubble->ShouldShow())
37 return; 37 return;
38 38
39 ExtensionMessageBubbleView* bubble = new ExtensionMessageBubbleView( 39 ExtensionMessageBubbleView* bubble = new ExtensionMessageBubbleView(
40 anchor_view, arrow, std::move(settings_api_bubble)); 40 anchor_view, arrow, std::move(settings_api_bubble));
41 views::BubbleDelegateView::CreateBubble(bubble); 41 views::BubbleDelegateView::CreateBubble(bubble);
42 bubble->Show(); 42 bubble->Show();
43 } 43 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // See if the current active URL matches a transformed NewTab URL. 94 // See if the current active URL matches a transformed NewTab URL.
95 GURL ntp_url(chrome::kChromeUINewTabURL); 95 GURL ntp_url(chrome::kChromeUINewTabURL);
96 bool ignored_param; 96 bool ignored_param;
97 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( 97 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary(
98 &ntp_url, 98 &ntp_url,
99 web_contents->GetBrowserContext(), 99 web_contents->GetBrowserContext(),
100 &ignored_param); 100 &ignored_param);
101 if (ntp_url != active_url) 101 if (ntp_url != active_url)
102 return; // Not being overridden by an extension. 102 return; // Not being overridden by an extension.
103 103
104 scoped_ptr<ExtensionMessageBubbleController> ntp_overridden_bubble( 104 std::unique_ptr<ExtensionMessageBubbleController> ntp_overridden_bubble(
105 new ExtensionMessageBubbleController( 105 new ExtensionMessageBubbleController(
106 new NtpOverriddenBubbleDelegate(browser->profile()), browser)); 106 new NtpOverriddenBubbleDelegate(browser->profile()), browser));
107 if (!ntp_overridden_bubble->ShouldShow()) 107 if (!ntp_overridden_bubble->ShouldShow())
108 return; 108 return;
109 109
110 ExtensionMessageBubbleView* bubble = new ExtensionMessageBubbleView( 110 ExtensionMessageBubbleView* bubble = new ExtensionMessageBubbleView(
111 BrowserView::GetBrowserViewForBrowser(browser) 111 BrowserView::GetBrowserViewForBrowser(browser)
112 ->toolbar() 112 ->toolbar()
113 ->app_menu_button(), 113 ->app_menu_button(),
114 views::BubbleBorder::TOP_RIGHT, std::move(ntp_overridden_bubble)); 114 views::BubbleBorder::TOP_RIGHT, std::move(ntp_overridden_bubble));
115 views::BubbleDelegateView::CreateBubble(bubble); 115 views::BubbleDelegateView::CreateBubble(bubble);
116 bubble->Show(); 116 bubble->Show();
117 } 117 }
118 118
119 } // namespace extensions 119 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/session_crashed_bubble_view.cc ('k') | chrome/browser/ui/views/ssl_client_certificate_selector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698