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

Side by Side Diff: chrome/browser/ui/panels/panel_host.cc

Issue 10837090: Change return type of FaviconTabHelper::GetFavicon() to gfx::Image. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win? Created 8 years, 4 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) 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/ui/panels/panel_host.h" 5 #include "chrome/browser/ui/panels/panel_host.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "chrome/browser/chrome_page_zoom.h" 9 #include "chrome/browser/chrome_page_zoom.h"
10 #include "chrome/browser/favicon/favicon_tab_helper.h" 10 #include "chrome/browser/favicon/favicon_tab_helper.h"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/ui/panels/panel.h" 12 #include "chrome/browser/ui/panels/panel.h"
13 #include "chrome/browser/view_type_utils.h" 13 #include "chrome/browser/view_type_utils.h"
14 #include "chrome/common/chrome_notification_types.h" 14 #include "chrome/common/chrome_notification_types.h"
15 #include "chrome/common/extensions/extension_messages.h" 15 #include "chrome/common/extensions/extension_messages.h"
16 #include "content/public/browser/invalidate_type.h" 16 #include "content/public/browser/invalidate_type.h"
17 #include "content/public/browser/navigation_controller.h" 17 #include "content/public/browser/navigation_controller.h"
18 #include "content/public/browser/notification_service.h" 18 #include "content/public/browser/notification_service.h"
19 #include "content/public/browser/notification_source.h" 19 #include "content/public/browser/notification_source.h"
20 #include "content/public/browser/notification_types.h" 20 #include "content/public/browser/notification_types.h"
21 #include "content/public/browser/render_view_host.h" 21 #include "content/public/browser/render_view_host.h"
22 #include "content/public/browser/site_instance.h" 22 #include "content/public/browser/site_instance.h"
23 #include "content/public/browser/user_metrics.h" 23 #include "content/public/browser/user_metrics.h"
24 #include "content/public/browser/web_contents.h" 24 #include "content/public/browser/web_contents.h"
25 #include "ui/gfx/image/image.h"
25 #include "ipc/ipc_message.h" 26 #include "ipc/ipc_message.h"
26 #include "ipc/ipc_message_macros.h" 27 #include "ipc/ipc_message_macros.h"
27 #include "third_party/skia/include/core/SkBitmap.h" 28 #include "third_party/skia/include/core/SkBitmap.h"
28 #include "ui/gfx/rect.h" 29 #include "ui/gfx/rect.h"
29 30
30 using content::UserMetricsAction; 31 using content::UserMetricsAction;
31 32
32 PanelHost::PanelHost(Panel* panel, Profile* profile) 33 PanelHost::PanelHost(Panel* panel, Profile* profile)
33 : panel_(panel), 34 : panel_(panel),
34 profile_(profile), 35 profile_(profile),
(...skipping 20 matching lines...) Expand all
55 web_contents_->GetController().LoadURL( 56 web_contents_->GetController().LoadURL(
56 url, content::Referrer(), content::PAGE_TRANSITION_LINK, std::string()); 57 url, content::Referrer(), content::PAGE_TRANSITION_LINK, std::string());
57 } 58 }
58 59
59 void PanelHost::DestroyWebContents() { 60 void PanelHost::DestroyWebContents() {
60 web_contents_.reset(); 61 web_contents_.reset();
61 favicon_tab_helper_.reset(); 62 favicon_tab_helper_.reset();
62 } 63 }
63 64
64 SkBitmap PanelHost::GetPageIcon() const { 65 SkBitmap PanelHost::GetPageIcon() const {
66 // TODO: Make this function return gfx::Image.
jennb 2012/08/03 16:55:36 What's needed to make this return gfx::Image? Simp
Nico 2012/08/03 19:09:54 I don't know how involved that is. I'd prefer not
65 return favicon_tab_helper_.get() ? 67 return favicon_tab_helper_.get() ?
66 favicon_tab_helper_->GetFavicon() : SkBitmap(); 68 favicon_tab_helper_->GetFavicon().AsBitmap() : SkBitmap();
67 } 69 }
68 70
69 void PanelHost::NavigationStateChanged(const content::WebContents* source, 71 void PanelHost::NavigationStateChanged(const content::WebContents* source,
70 unsigned changed_flags) { 72 unsigned changed_flags) {
71 // Only need to update the title if the title changed while not loading, 73 // Only need to update the title if the title changed while not loading,
72 // because the title is also updated when loading state changes. 74 // because the title is also updated when loading state changes.
73 if ((changed_flags & content::INVALIDATE_TYPE_TAB) || 75 if ((changed_flags & content::INVALIDATE_TYPE_TAB) ||
74 ((changed_flags & content::INVALIDATE_TYPE_TITLE) && 76 ((changed_flags & content::INVALIDATE_TYPE_TITLE) &&
75 !source->IsLoading())) 77 !source->IsLoading()))
76 panel_->UpdateTitleBar(); 78 panel_->UpdateTitleBar();
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 } 183 }
182 184
183 void PanelHost::StopLoading() { 185 void PanelHost::StopLoading() {
184 content::RecordAction(UserMetricsAction("Stop")); 186 content::RecordAction(UserMetricsAction("Stop"));
185 web_contents_->Stop(); 187 web_contents_->Stop();
186 } 188 }
187 189
188 void PanelHost::Zoom(content::PageZoom zoom) { 190 void PanelHost::Zoom(content::PageZoom zoom) {
189 chrome_page_zoom::Zoom(web_contents_.get(), zoom); 191 chrome_page_zoom::Zoom(web_contents_.get(), zoom);
190 } 192 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698