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

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

Issue 657333002: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/views/external_protocol_dialog.h" 5 #include "chrome/browser/ui/views/external_protocol_dialog.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/external_protocol/external_protocol_handler.h" 10 #include "chrome/browser/external_protocol/external_protocol_handler.h"
(...skipping 24 matching lines...) Expand all
35 scoped_ptr<ExternalProtocolDialogDelegate> delegate( 35 scoped_ptr<ExternalProtocolDialogDelegate> delegate(
36 new ExternalProtocolDialogDelegate(url, 36 new ExternalProtocolDialogDelegate(url,
37 render_process_host_id, 37 render_process_host_id,
38 routing_id)); 38 routing_id));
39 if (delegate->program_name().empty()) { 39 if (delegate->program_name().empty()) {
40 // ShellExecute won't do anything. Don't bother warning the user. 40 // ShellExecute won't do anything. Don't bother warning the user.
41 return; 41 return;
42 } 42 }
43 43
44 // Windowing system takes ownership. 44 // Windowing system takes ownership.
45 new ExternalProtocolDialog(delegate.PassAs<const ProtocolDialogDelegate>(), 45 new ExternalProtocolDialog(
46 render_process_host_id, 46 delegate.Pass(), render_process_host_id, routing_id);
47 routing_id);
48 } 47 }
49 48
50 /////////////////////////////////////////////////////////////////////////////// 49 ///////////////////////////////////////////////////////////////////////////////
51 // ExternalProtocolDialog 50 // ExternalProtocolDialog
52 51
53 ExternalProtocolDialog::~ExternalProtocolDialog() { 52 ExternalProtocolDialog::~ExternalProtocolDialog() {
54 } 53 }
55 54
56 ////////////////////////////////////////////////////////////////////////////// 55 //////////////////////////////////////////////////////////////////////////////
57 // ExternalProtocolDialog, views::DialogDelegate implementation: 56 // ExternalProtocolDialog, views::DialogDelegate implementation:
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 message_box_view_->SetCheckBoxLabel(delegate_->GetCheckboxText()); 130 message_box_view_->SetCheckBoxLabel(delegate_->GetCheckboxText());
132 131
133 // Dialog is top level if we don't have a web_contents associated with us. 132 // Dialog is top level if we don't have a web_contents associated with us.
134 WebContents* web_contents = tab_util::GetWebContentsByID( 133 WebContents* web_contents = tab_util::GetWebContentsByID(
135 render_process_host_id_, routing_id_); 134 render_process_host_id_, routing_id_);
136 gfx::NativeWindow parent_window = NULL; 135 gfx::NativeWindow parent_window = NULL;
137 if (web_contents) 136 if (web_contents)
138 parent_window = web_contents->GetTopLevelNativeWindow(); 137 parent_window = web_contents->GetTopLevelNativeWindow();
139 CreateBrowserModalDialogViews(this, parent_window)->Show(); 138 CreateBrowserModalDialogViews(this, parent_window)->Show();
140 } 139 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/extensions/extension_view_views.cc ('k') | chrome/browser/ui/views/fullscreen_exit_bubble_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698