| 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 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 | 618 |
| 619 // Unlike other window types, Panels do not take focus by default. | 619 // Unlike other window types, Panels do not take focus by default. |
| 620 if (!saw_focus_key && create_panel) | 620 if (!saw_focus_key && create_panel) |
| 621 focused = false; | 621 focused = false; |
| 622 | 622 |
| 623 if (focused) | 623 if (focused) |
| 624 new_window->window()->Show(); | 624 new_window->window()->Show(); |
| 625 else | 625 else |
| 626 new_window->window()->ShowInactive(); | 626 new_window->window()->ShowInactive(); |
| 627 | 627 |
| 628 if (new_window->profile()->IsOffTheRecord() && !include_incognito()) { | 628 if (new_window->profile()->IsOffTheRecord() && |
| 629 // Don't expose incognito windows if the extension isn't allowed. | 629 !GetProfile()->IsOffTheRecord() && !include_incognito()) { |
| 630 // Don't expose incognito windows if extension itself works in non-incognito |
| 631 // profile and CanCrossIncognito isn't allowed. |
| 630 SetResult(Value::CreateNullValue()); | 632 SetResult(Value::CreateNullValue()); |
| 631 } else { | 633 } else { |
| 632 SetResult( | 634 SetResult( |
| 633 new_window->extension_window_controller()->CreateWindowValueWithTabs( | 635 new_window->extension_window_controller()->CreateWindowValueWithTabs( |
| 634 GetExtension())); | 636 GetExtension())); |
| 635 } | 637 } |
| 636 | 638 |
| 637 return true; | 639 return true; |
| 638 } | 640 } |
| 639 | 641 |
| (...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2065 execute_tab_id_ = tab_id; | 2067 execute_tab_id_ = tab_id; |
| 2066 details_ = details.Pass(); | 2068 details_ = details.Pass(); |
| 2067 return true; | 2069 return true; |
| 2068 } | 2070 } |
| 2069 | 2071 |
| 2070 bool TabsInsertCSSFunction::ShouldInsertCSS() const { | 2072 bool TabsInsertCSSFunction::ShouldInsertCSS() const { |
| 2071 return true; | 2073 return true; |
| 2072 } | 2074 } |
| 2073 | 2075 |
| 2074 } // namespace extensions | 2076 } // namespace extensions |
| OLD | NEW |