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

Side by Side Diff: chrome/browser/ui/extensions/app_launch_params.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 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/extensions/app_launch_params.h" 5 #include "chrome/browser/ui/extensions/app_launch_params.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "chrome/browser/extensions/launch_util.h" 8 #include "chrome/browser/extensions/launch_util.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "extensions/browser/extension_prefs.h" 10 #include "extensions/browser/extension_prefs.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 AppLaunchParams CreateAppLaunchParamsWithEventFlags( 64 AppLaunchParams CreateAppLaunchParamsWithEventFlags(
65 Profile* profile, 65 Profile* profile,
66 const extensions::Extension* extension, 66 const extensions::Extension* extension,
67 int event_flags, 67 int event_flags,
68 extensions::AppLaunchSource source) { 68 extensions::AppLaunchSource source) {
69 WindowOpenDisposition raw_disposition = 69 WindowOpenDisposition raw_disposition =
70 ui::DispositionFromEventFlags(event_flags); 70 ui::DispositionFromEventFlags(event_flags);
71 71
72 extensions::LaunchContainer container; 72 extensions::LaunchContainer container;
73 WindowOpenDisposition disposition; 73 WindowOpenDisposition disposition;
74 if (raw_disposition == NEW_FOREGROUND_TAB || 74 if (raw_disposition == WindowOpenDisposition::NEW_FOREGROUND_TAB ||
75 raw_disposition == NEW_BACKGROUND_TAB) { 75 raw_disposition == WindowOpenDisposition::NEW_BACKGROUND_TAB) {
76 container = extensions::LAUNCH_CONTAINER_TAB; 76 container = extensions::LAUNCH_CONTAINER_TAB;
77 disposition = raw_disposition; 77 disposition = raw_disposition;
78 } else if (raw_disposition == NEW_WINDOW) { 78 } else if (raw_disposition == WindowOpenDisposition::NEW_WINDOW) {
79 container = extensions::LAUNCH_CONTAINER_WINDOW; 79 container = extensions::LAUNCH_CONTAINER_WINDOW;
80 disposition = raw_disposition; 80 disposition = raw_disposition;
81 } else { 81 } else {
82 // Look at preference to find the right launch container. If no preference 82 // Look at preference to find the right launch container. If no preference
83 // is set, launch as a regular tab. 83 // is set, launch as a regular tab.
84 container = 84 container =
85 extensions::GetLaunchContainer(ExtensionPrefs::Get(profile), extension); 85 extensions::GetLaunchContainer(ExtensionPrefs::Get(profile), extension);
86 disposition = NEW_FOREGROUND_TAB; 86 disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB;
87 } 87 }
88 return AppLaunchParams(profile, extension, container, disposition, source); 88 return AppLaunchParams(profile, extension, container, disposition, source);
89 } 89 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/exclusive_access/fullscreen_controller_test.cc ('k') | chrome/browser/ui/extensions/application_launch.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698