OLD | NEW |
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/extensions/api/tabs/tabs_api.h" | 5 #include "chrome/browser/extensions/api/tabs/tabs_api.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <limits> | 9 #include <limits> |
10 #include <memory> | 10 #include <memory> |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 void AssignOptionalValue(const std::unique_ptr<T>& source, | 195 void AssignOptionalValue(const std::unique_ptr<T>& source, |
196 std::unique_ptr<T>& destination) { | 196 std::unique_ptr<T>& destination) { |
197 if (source.get()) { | 197 if (source.get()) { |
198 destination.reset(new T(*source)); | 198 destination.reset(new T(*source)); |
199 } | 199 } |
200 } | 200 } |
201 | 201 |
202 ui::WindowShowState ConvertToWindowShowState(windows::WindowState state) { | 202 ui::WindowShowState ConvertToWindowShowState(windows::WindowState state) { |
203 switch (state) { | 203 switch (state) { |
204 case windows::WINDOW_STATE_NORMAL: | 204 case windows::WINDOW_STATE_NORMAL: |
205 case windows::WINDOW_STATE_DOCKED: | |
206 return ui::SHOW_STATE_NORMAL; | 205 return ui::SHOW_STATE_NORMAL; |
207 case windows::WINDOW_STATE_MINIMIZED: | 206 case windows::WINDOW_STATE_MINIMIZED: |
208 return ui::SHOW_STATE_MINIMIZED; | 207 return ui::SHOW_STATE_MINIMIZED; |
209 case windows::WINDOW_STATE_MAXIMIZED: | 208 case windows::WINDOW_STATE_MAXIMIZED: |
210 return ui::SHOW_STATE_MAXIMIZED; | 209 return ui::SHOW_STATE_MAXIMIZED; |
211 case windows::WINDOW_STATE_FULLSCREEN: | 210 case windows::WINDOW_STATE_FULLSCREEN: |
212 return ui::SHOW_STATE_FULLSCREEN; | 211 return ui::SHOW_STATE_FULLSCREEN; |
213 case windows::WINDOW_STATE_NONE: | 212 case windows::WINDOW_STATE_NONE: |
214 return ui::SHOW_STATE_DEFAULT; | 213 return ui::SHOW_STATE_DEFAULT; |
215 } | 214 } |
(...skipping 14 matching lines...) Expand all Loading... |
230 case windows::WINDOW_STATE_MINIMIZED: | 229 case windows::WINDOW_STATE_MINIMIZED: |
231 // If minimised, default focused state should be unfocused. | 230 // If minimised, default focused state should be unfocused. |
232 return !(create_data->focused && *create_data->focused) && !has_bound && | 231 return !(create_data->focused && *create_data->focused) && !has_bound && |
233 !is_panel; | 232 !is_panel; |
234 case windows::WINDOW_STATE_MAXIMIZED: | 233 case windows::WINDOW_STATE_MAXIMIZED: |
235 case windows::WINDOW_STATE_FULLSCREEN: | 234 case windows::WINDOW_STATE_FULLSCREEN: |
236 // If maximised/fullscreen, default focused state should be focused. | 235 // If maximised/fullscreen, default focused state should be focused. |
237 return !(create_data->focused && !*create_data->focused) && !has_bound && | 236 return !(create_data->focused && !*create_data->focused) && !has_bound && |
238 !is_panel; | 237 !is_panel; |
239 case windows::WINDOW_STATE_NORMAL: | 238 case windows::WINDOW_STATE_NORMAL: |
240 case windows::WINDOW_STATE_DOCKED: | |
241 case windows::WINDOW_STATE_NONE: | 239 case windows::WINDOW_STATE_NONE: |
242 return true; | 240 return true; |
243 } | 241 } |
244 NOTREACHED(); | 242 NOTREACHED(); |
245 return true; | 243 return true; |
246 } | 244 } |
247 | 245 |
248 } // namespace | 246 } // namespace |
249 | 247 |
250 void ZoomModeToZoomSettings(ZoomController::ZoomMode zoom_mode, | 248 void ZoomModeToZoomSettings(ZoomController::ZoomMode zoom_mode, |
(...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2122 params->tab_id | 2120 params->tab_id |
2123 ? ErrorUtils::FormatErrorMessage(keys::kCannotDiscardTab, | 2121 ? ErrorUtils::FormatErrorMessage(keys::kCannotDiscardTab, |
2124 base::IntToString(*params->tab_id)) | 2122 base::IntToString(*params->tab_id)) |
2125 : keys::kCannotFindTabToDiscard)); | 2123 : keys::kCannotFindTabToDiscard)); |
2126 } | 2124 } |
2127 | 2125 |
2128 TabsDiscardFunction::TabsDiscardFunction() {} | 2126 TabsDiscardFunction::TabsDiscardFunction() {} |
2129 TabsDiscardFunction::~TabsDiscardFunction() {} | 2127 TabsDiscardFunction::~TabsDiscardFunction() {} |
2130 | 2128 |
2131 } // namespace extensions | 2129 } // namespace extensions |
OLD | NEW |