| OLD | NEW |
| 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_host.h" | 5 #include "chrome/browser/extensions/extension_host.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 | 682 |
| 683 // If there's no associated tab contents, or it doesn't have a matching | 683 // If there's no associated tab contents, or it doesn't have a matching |
| 684 // profile, try finding an open window. Again, we must make sure to find a | 684 // profile, try finding an open window. Again, we must make sure to find a |
| 685 // window with the correct profile. | 685 // window with the correct profile. |
| 686 Browser* browser = BrowserList::FindTabbedBrowser( | 686 Browser* browser = BrowserList::FindTabbedBrowser( |
| 687 profile, false); // Match incognito exactly. | 687 profile, false); // Match incognito exactly. |
| 688 | 688 |
| 689 // If there's no Browser open with the right profile, create a new one. | 689 // If there's no Browser open with the right profile, create a new one. |
| 690 if (!browser) { | 690 if (!browser) { |
| 691 browser = Browser::Create(profile); | 691 browser = Browser::Create(profile); |
| 692 browser->window()->Show(); | 692 browser->window()->Show(BrowserWindow::SHOW_CONTEXT_NORMAL); |
| 693 } | 693 } |
| 694 browser->AddTabContents(contents, disposition, initial_pos, user_gesture); | 694 browser->AddTabContents(contents, disposition, initial_pos, user_gesture); |
| 695 } | 695 } |
| 696 | 696 |
| 697 void ExtensionHost::ShowCreatedWidget(int route_id, | 697 void ExtensionHost::ShowCreatedWidget(int route_id, |
| 698 const gfx::Rect& initial_pos) { | 698 const gfx::Rect& initial_pos) { |
| 699 ShowCreatedWidgetInternal(delegate_view_helper_.GetCreatedWidget(route_id), | 699 ShowCreatedWidgetInternal(delegate_view_helper_.GetCreatedWidget(route_id), |
| 700 initial_pos); | 700 initial_pos); |
| 701 } | 701 } |
| 702 | 702 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 if (view_.get()) | 792 if (view_.get()) |
| 793 view_->RenderViewCreated(); | 793 view_->RenderViewCreated(); |
| 794 | 794 |
| 795 if (extension_host_type_ == ViewType::EXTENSION_POPUP || | 795 if (extension_host_type_ == ViewType::EXTENSION_POPUP || |
| 796 extension_host_type_ == ViewType::EXTENSION_INFOBAR) { | 796 extension_host_type_ == ViewType::EXTENSION_INFOBAR) { |
| 797 render_view_host->Send(new ViewMsg_EnablePreferredSizeChangedMode( | 797 render_view_host->Send(new ViewMsg_EnablePreferredSizeChangedMode( |
| 798 render_view_host->routing_id(), | 798 render_view_host->routing_id(), |
| 799 kPreferredSizeWidth | kPreferredSizeHeightThisIsSlow)); | 799 kPreferredSizeWidth | kPreferredSizeHeightThisIsSlow)); |
| 800 } | 800 } |
| 801 } | 801 } |
| OLD | NEW |