Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Side by Side Diff: chrome/browser/extensions/extension_tabs_module.cc

Issue 8863011: Panels back behind a flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/extensions/window_open_apitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/extension_tabs_module.h" 5 #include "chrome/browser/extensions/extension_tabs_module.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 13 matching lines...) Expand all
24 #include "chrome/browser/net/url_fixer_upper.h" 24 #include "chrome/browser/net/url_fixer_upper.h"
25 #include "chrome/browser/prefs/incognito_mode_prefs.h" 25 #include "chrome/browser/prefs/incognito_mode_prefs.h"
26 #include "chrome/browser/profiles/profile.h" 26 #include "chrome/browser/profiles/profile.h"
27 #include "chrome/browser/sessions/restore_tab_helper.h" 27 #include "chrome/browser/sessions/restore_tab_helper.h"
28 #include "chrome/browser/tabs/tab_strip_model.h" 28 #include "chrome/browser/tabs/tab_strip_model.h"
29 #include "chrome/browser/translate/translate_tab_helper.h" 29 #include "chrome/browser/translate/translate_tab_helper.h"
30 #include "chrome/browser/ui/browser.h" 30 #include "chrome/browser/ui/browser.h"
31 #include "chrome/browser/ui/browser_list.h" 31 #include "chrome/browser/ui/browser_list.h"
32 #include "chrome/browser/ui/browser_navigator.h" 32 #include "chrome/browser/ui/browser_navigator.h"
33 #include "chrome/browser/ui/browser_window.h" 33 #include "chrome/browser/ui/browser_window.h"
34 #include "chrome/browser/ui/panels/panel_manager.h"
34 #include "chrome/browser/ui/snapshot_tab_helper.h" 35 #include "chrome/browser/ui/snapshot_tab_helper.h"
35 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 36 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
36 #include "chrome/browser/ui/window_sizer.h" 37 #include "chrome/browser/ui/window_sizer.h"
37 #include "chrome/browser/web_applications/web_app.h" 38 #include "chrome/browser/web_applications/web_app.h"
38 #include "chrome/common/chrome_notification_types.h" 39 #include "chrome/common/chrome_notification_types.h"
39 #include "chrome/common/chrome_switches.h" 40 #include "chrome/common/chrome_switches.h"
40 #include "chrome/common/extensions/extension.h" 41 #include "chrome/common/extensions/extension.h"
41 #include "chrome/common/extensions/extension_error_utils.h" 42 #include "chrome/common/extensions/extension_error_utils.h"
42 #include "chrome/common/extensions/extension_messages.h" 43 #include "chrome/common/extensions/extension_messages.h"
43 #include "chrome/common/pref_names.h" 44 #include "chrome/common/pref_names.h"
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 } 456 }
456 457
457 std::string type_str; 458 std::string type_str;
458 if (args->HasKey(keys::kWindowTypeKey)) { 459 if (args->HasKey(keys::kWindowTypeKey)) {
459 EXTENSION_FUNCTION_VALIDATE(args->GetString(keys::kWindowTypeKey, 460 EXTENSION_FUNCTION_VALIDATE(args->GetString(keys::kWindowTypeKey,
460 &type_str)); 461 &type_str));
461 if (type_str == keys::kWindowTypeValuePopup) { 462 if (type_str == keys::kWindowTypeValuePopup) {
462 window_type = Browser::TYPE_POPUP; 463 window_type = Browser::TYPE_POPUP;
463 extension_id = GetExtension()->id(); 464 extension_id = GetExtension()->id();
464 } else if (type_str == keys::kWindowTypeValuePanel) { 465 } else if (type_str == keys::kWindowTypeValuePanel) {
465 if (CommandLine::ForCurrentProcess()->HasSwitch( 466 extension_id = GetExtension()->id();
466 switches::kDisablePanels)) { 467 if (PanelManager::ShouldUsePanels(extension_id))
468 window_type = Browser::TYPE_PANEL;
469 else
467 window_type = Browser::TYPE_POPUP; 470 window_type = Browser::TYPE_POPUP;
468 } else {
469 window_type = Browser::TYPE_PANEL;
470 }
471 extension_id = GetExtension()->id();
472 } else if (type_str != keys::kWindowTypeValueNormal) { 471 } else if (type_str != keys::kWindowTypeValueNormal) {
473 error_ = keys::kInvalidWindowTypeError; 472 error_ = keys::kInvalidWindowTypeError;
474 return false; 473 return false;
475 } 474 }
476 } 475 }
477 } 476 }
478 477
479 // Unlike other window types, Panels do not take focus by default. 478 // Unlike other window types, Panels do not take focus by default.
480 if (!saw_focus_key && window_type == Browser::TYPE_PANEL) 479 if (!saw_focus_key && window_type == Browser::TYPE_PANEL)
481 focused = false; 480 focused = false;
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 // called for every API call the extension made. 1615 // called for every API call the extension made.
1617 GotLanguage(language); 1616 GotLanguage(language);
1618 } 1617 }
1619 1618
1620 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { 1619 void DetectTabLanguageFunction::GotLanguage(const std::string& language) {
1621 result_.reset(Value::CreateStringValue(language.c_str())); 1620 result_.reset(Value::CreateStringValue(language.c_str()));
1622 SendResponse(true); 1621 SendResponse(true);
1623 1622
1624 Release(); // Balanced in Run() 1623 Release(); // Balanced in Run()
1625 } 1624 }
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/extensions/window_open_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698