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

Side by Side Diff: content/browser/webui/generic_handler.cc

Issue 2248873002: Convert WindowOpenDisposition to an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/browser/webui/generic_handler.h" 5 #include "content/browser/webui/generic_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 29 matching lines...) Expand all
40 CHECK(args->GetBoolean(3, &alt_key)); 40 CHECK(args->GetBoolean(3, &alt_key));
41 CHECK(args->GetBoolean(4, &ctrl_key)); 41 CHECK(args->GetBoolean(4, &ctrl_key));
42 CHECK(args->GetBoolean(5, &meta_key)); 42 CHECK(args->GetBoolean(5, &meta_key));
43 CHECK(args->GetBoolean(6, &shift_key)); 43 CHECK(args->GetBoolean(6, &shift_key));
44 44
45 CHECK(button == 0.0 || button == 1.0); 45 CHECK(button == 0.0 || button == 1.0);
46 bool middle_button = (button == 1.0); 46 bool middle_button = (button == 1.0);
47 47
48 WindowOpenDisposition disposition = ui::DispositionFromClick( 48 WindowOpenDisposition disposition = ui::DispositionFromClick(
49 middle_button, alt_key, ctrl_key, meta_key, shift_key); 49 middle_button, alt_key, ctrl_key, meta_key, shift_key);
50 if (disposition == CURRENT_TAB && target_string == "_blank") 50 if (disposition == WindowOpenDisposition::CURRENT_TAB &&
51 disposition = NEW_FOREGROUND_TAB; 51 target_string == "_blank")
52 disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB;
52 53
53 web_ui()->GetWebContents()->OpenURL(OpenURLParams(GURL(url_string), 54 web_ui()->GetWebContents()->OpenURL(OpenURLParams(GURL(url_string),
54 Referrer(), 55 Referrer(),
55 disposition, 56 disposition,
56 ui::PAGE_TRANSITION_LINK, 57 ui::PAGE_TRANSITION_LINK,
57 false)); 58 false));
58 59
59 // This may delete us! 60 // This may delete us!
60 } 61 }
61 62
62 } // namespace content 63 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_drag_dest_mac.mm ('k') | content/public/browser/page_navigator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698