| 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 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 &focused)); | 592 &focused)); |
| 593 saw_focus_key = true; | 593 saw_focus_key = true; |
| 594 } | 594 } |
| 595 } | 595 } |
| 596 | 596 |
| 597 if (window_type == Browser::TYPE_PANEL) { | 597 if (window_type == Browser::TYPE_PANEL) { |
| 598 if (urls.empty()) | 598 if (urls.empty()) |
| 599 urls.push_back(GURL(chrome::kChromeUINewTabURL)); | 599 urls.push_back(GURL(chrome::kChromeUINewTabURL)); |
| 600 | 600 |
| 601 #if defined(OS_CHROMEOS) | 601 #if defined(OS_CHROMEOS) |
| 602 if (PanelManager::ShouldUsePanels(extension_id)) { | 602 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePanels) && |
| 603 PanelManager::ShouldUsePanels(extension_id)) { |
| 603 ShellWindow::CreateParams create_params; | 604 ShellWindow::CreateParams create_params; |
| 604 create_params.window_type = ShellWindow::WINDOW_TYPE_V1_PANEL; | 605 create_params.window_type = ShellWindow::WINDOW_TYPE_V1_PANEL; |
| 605 create_params.bounds = window_bounds; | 606 create_params.bounds = window_bounds; |
| 606 create_params.minimum_size = window_bounds.size(); | 607 create_params.minimum_size = window_bounds.size(); |
| 607 create_params.maximum_size = window_bounds.size(); | 608 create_params.maximum_size = window_bounds.size(); |
| 608 ShellWindow* shell_window = | 609 ShellWindow* shell_window = |
| 609 new ShellWindow(window_profile, GetExtension()); | 610 new ShellWindow(window_profile, GetExtension()); |
| 610 AshPanelContents* ash_panel_contents = new AshPanelContents(shell_window); | 611 AshPanelContents* ash_panel_contents = new AshPanelContents(shell_window); |
| 611 shell_window->Init(urls[0], ash_panel_contents, create_params); | 612 shell_window->Init(urls[0], ash_panel_contents, create_params); |
| 612 SetResult(ash_panel_contents->GetExtensionWindowController()-> | 613 SetResult(ash_panel_contents->GetExtensionWindowController()-> |
| (...skipping 1541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2154 extension->id(), | 2155 extension->id(), |
| 2155 script_type, | 2156 script_type, |
| 2156 code_string, | 2157 code_string, |
| 2157 frame_scope, | 2158 frame_scope, |
| 2158 run_at, | 2159 run_at, |
| 2159 ScriptExecutor::ISOLATED_WORLD, | 2160 ScriptExecutor::ISOLATED_WORLD, |
| 2160 false /* is_web_view */, | 2161 false /* is_web_view */, |
| 2161 base::Bind(&ExecuteCodeInTabFunction::OnExecuteCodeFinished, this)); | 2162 base::Bind(&ExecuteCodeInTabFunction::OnExecuteCodeFinished, this)); |
| 2162 return true; | 2163 return true; |
| 2163 } | 2164 } |
| OLD | NEW |