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 <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 if (!saw_focus_key && create_panel) | 652 if (!saw_focus_key && create_panel) |
653 focused = false; | 653 focused = false; |
654 | 654 |
655 if (focused) | 655 if (focused) |
656 new_window->window()->Show(); | 656 new_window->window()->Show(); |
657 else | 657 else |
658 new_window->window()->ShowInactive(); | 658 new_window->window()->ShowInactive(); |
659 | 659 |
660 WindowController* controller = new_window->extension_window_controller(); | 660 WindowController* controller = new_window->extension_window_controller(); |
661 | 661 |
662 #if defined(OS_CHROMEOS) | |
663 // For ChromeOS, manually Minimize(). Because minimzied window is not | |
664 // considered to create new window. See http://crbug.com/473228. | |
665 if (create_params.initial_show_state == ui::SHOW_STATE_MINIMIZED) | |
666 new_window->window()->Minimize(); | |
667 #endif | |
668 | |
669 if (new_window->profile()->IsOffTheRecord() && | 662 if (new_window->profile()->IsOffTheRecord() && |
670 !GetProfile()->IsOffTheRecord() && !include_incognito()) { | 663 !GetProfile()->IsOffTheRecord() && !include_incognito()) { |
671 // Don't expose incognito windows if extension itself works in non-incognito | 664 // Don't expose incognito windows if extension itself works in non-incognito |
672 // profile and CanCrossIncognito isn't allowed. | 665 // profile and CanCrossIncognito isn't allowed. |
673 SetResult(base::Value::CreateNullValue()); | 666 SetResult(base::Value::CreateNullValue()); |
674 } else { | 667 } else { |
675 SetResult(controller->CreateWindowValueWithTabs(extension())); | 668 SetResult(controller->CreateWindowValueWithTabs(extension())); |
676 } | 669 } |
677 | 670 |
678 return true; | 671 return true; |
(...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1995 ZoomModeToZoomSettings(zoom_mode, &zoom_settings); | 1988 ZoomModeToZoomSettings(zoom_mode, &zoom_settings); |
1996 zoom_settings.default_zoom_factor.reset(new double( | 1989 zoom_settings.default_zoom_factor.reset(new double( |
1997 content::ZoomLevelToZoomFactor(zoom_controller->GetDefaultZoomLevel()))); | 1990 content::ZoomLevelToZoomFactor(zoom_controller->GetDefaultZoomLevel()))); |
1998 | 1991 |
1999 results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings); | 1992 results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings); |
2000 SendResponse(true); | 1993 SendResponse(true); |
2001 return true; | 1994 return true; |
2002 } | 1995 } |
2003 | 1996 |
2004 } // namespace extensions | 1997 } // namespace extensions |
OLD | NEW |