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

Side by Side Diff: chrome/browser/sidebar/sidebar_container.cc

Issue 7096016: Remove JS dialog dependency from content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: now a tc delegate Created 9 years, 6 months 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
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/sidebar/sidebar_container.h" 5 #include "chrome/browser/sidebar/sidebar_container.h"
6 6
7 #include "chrome/browser/extensions/extension_service.h" 7 #include "chrome/browser/extensions/extension_service.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h"
9 #include "chrome/common/extensions/extension.h" 10 #include "chrome/common/extensions/extension.h"
10 #include "chrome/common/extensions/extension_resource.h" 11 #include "chrome/common/extensions/extension_resource.h"
11 #include "chrome/common/extensions/extension_sidebar_defaults.h" 12 #include "chrome/common/extensions/extension_sidebar_defaults.h"
12 #include "chrome/common/extensions/extension_sidebar_utils.h" 13 #include "chrome/common/extensions/extension_sidebar_utils.h"
13 #include "content/browser/renderer_host/browser_render_process_host.h" 14 #include "content/browser/renderer_host/browser_render_process_host.h"
14 #include "content/browser/renderer_host/render_view_host.h" 15 #include "content/browser/renderer_host/render_view_host.h"
15 #include "content/browser/tab_contents/navigation_controller.h" 16 #include "content/browser/tab_contents/navigation_controller.h"
16 #include "content/browser/tab_contents/navigation_entry.h" 17 #include "content/browser/tab_contents/navigation_entry.h"
17 #include "content/browser/tab_contents/tab_contents.h" 18 #include "content/browser/tab_contents/tab_contents.h"
18 #include "content/browser/tab_contents/tab_contents_view.h" 19 #include "content/browser/tab_contents/tab_contents_view.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 } 102 }
102 103
103 void SidebarContainer::SetTitle(const string16& title) { 104 void SidebarContainer::SetTitle(const string16& title) {
104 title_ = title; 105 title_ = title;
105 } 106 }
106 107
107 bool SidebarContainer::IsPopup(const TabContents* source) const { 108 bool SidebarContainer::IsPopup(const TabContents* source) const {
108 return false; 109 return false;
109 } 110 }
110 111
112 content::JavaScriptDialogCreator*
113 SidebarContainer::GetJavaScriptDialogCreator() {
114 return GetJavaScriptDialogCreatorInstance();
115 }
116
111 void SidebarContainer::OnImageLoaded(SkBitmap* image, 117 void SidebarContainer::OnImageLoaded(SkBitmap* image,
112 const ExtensionResource& resource, 118 const ExtensionResource& resource,
113 int index) { 119 int index) {
114 if (image && use_default_icon_) { 120 if (image && use_default_icon_) {
115 *icon_ = *image; 121 *icon_ = *image;
116 delegate_->UpdateSidebar(this); 122 delegate_->UpdateSidebar(this);
117 } 123 }
118 } 124 }
119 125
120 const Extension* SidebarContainer::GetExtension() const { 126 const Extension* SidebarContainer::GetExtension() const {
121 ExtensionService* service = 127 ExtensionService* service =
122 sidebar_contents_->profile()->GetExtensionService(); 128 sidebar_contents_->profile()->GetExtensionService();
123 if (!service) 129 if (!service)
124 return NULL; 130 return NULL;
125 return service->GetExtensionById( 131 return service->GetExtensionById(
126 extension_sidebar_utils::GetExtensionIdByContentId(content_id_), false); 132 extension_sidebar_utils::GetExtensionIdByContentId(content_id_), false);
127 } 133 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698