OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |