OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/sidebar/sidebar_container.h" | 5 #include "chrome/browser/sidebar/sidebar_container.h" |
6 | 6 |
7 #include "chrome/browser/renderer_host/render_view_host.h" | 7 #include "chrome/browser/renderer_host/render_view_host.h" |
8 #include "chrome/browser/tab_contents/navigation_controller.h" | 8 #include "chrome/browser/tab_contents/navigation_controller.h" |
9 #include "chrome/browser/tab_contents/navigation_entry.h" | 9 #include "chrome/browser/tab_contents/navigation_entry.h" |
10 #include "chrome/browser/tab_contents/tab_contents.h" | 10 #include "chrome/browser/tab_contents/tab_contents.h" |
11 #include "chrome/browser/tab_contents/tab_contents_view.h" | 11 #include "chrome/browser/tab_contents/tab_contents_view.h" |
12 #include "chrome/common/bindings_policy.h" | 12 #include "chrome/common/bindings_policy.h" |
13 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
14 #include "third_party/skia/include/core/SkBitmap.h" | 14 #include "third_party/skia/include/core/SkBitmap.h" |
15 | 15 |
16 SidebarContainer::SidebarContainer(TabContents* tab, | 16 SidebarContainer::SidebarContainer(TabContents* tab, |
17 const std::string& content_id, | 17 const std::string& content_id, |
18 Delegate* delegate) | 18 Delegate* delegate) |
19 : tab_(tab), | 19 : tab_(tab), |
20 content_id_(content_id), | 20 content_id_(content_id), |
21 delegate_(delegate), | 21 delegate_(delegate), |
22 icon_(new SkBitmap) { | 22 icon_(new SkBitmap) { |
23 // Create TabContents for sidebar. | 23 // Create TabContents for sidebar. |
24 sidebar_contents_.reset( | 24 sidebar_contents_.reset( |
25 new TabContents(tab->profile(), NULL, MSG_ROUTING_NONE, NULL)); | 25 new TabContents(tab->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL)); |
26 sidebar_contents_->render_view_host()->set_is_extension_process(true); | 26 sidebar_contents_->render_view_host()->set_is_extension_process(true); |
27 sidebar_contents_->render_view_host()->AllowBindings( | 27 sidebar_contents_->render_view_host()->AllowBindings( |
28 BindingsPolicy::EXTENSION); | 28 BindingsPolicy::EXTENSION); |
29 sidebar_contents_->set_delegate(this); | 29 sidebar_contents_->set_delegate(this); |
30 } | 30 } |
31 | 31 |
32 SidebarContainer::~SidebarContainer() { | 32 SidebarContainer::~SidebarContainer() { |
33 } | 33 } |
34 | 34 |
35 void SidebarContainer::SidebarClosing() { | 35 void SidebarContainer::SidebarClosing() { |
(...skipping 24 matching lines...) Expand all Loading... |
60 badge_text_ = badge_text; | 60 badge_text_ = badge_text; |
61 } | 61 } |
62 | 62 |
63 void SidebarContainer::SetIcon(const SkBitmap& bitmap) { | 63 void SidebarContainer::SetIcon(const SkBitmap& bitmap) { |
64 *icon_ = bitmap; | 64 *icon_ = bitmap; |
65 } | 65 } |
66 | 66 |
67 void SidebarContainer::SetTitle(const string16& title) { | 67 void SidebarContainer::SetTitle(const string16& title) { |
68 title_ = title; | 68 title_ = title; |
69 } | 69 } |
OLD | NEW |