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

Side by Side Diff: chrome/browser/views/notifications/balloon_view_host.cc

Issue 545054: Introduce all the plumbing for Session Storage. This mostly consists of crea... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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
« no previous file with comments | « chrome/browser/tab_contents/render_view_host_manager.cc ('k') | chrome/chrome_common.gypi » ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/views/notifications/balloon_view_host.h" 5 #include "chrome/browser/views/notifications/balloon_view_host.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "chrome/browser/browser_list.h" 8 #include "chrome/browser/browser_list.h"
9 #include "chrome/browser/notifications/balloon.h" 9 #include "chrome/browser/notifications/balloon.h"
10 #include "chrome/browser/notifications/notification.h" 10 #include "chrome/browser/notifications/notification.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 } 94 }
95 } 95 }
96 96
97 void BalloonViewHost::UpdatePreferredSize(const gfx::Size& new_size) { 97 void BalloonViewHost::UpdatePreferredSize(const gfx::Size& new_size) {
98 balloon_->SetContentPreferredSize(new_size); 98 balloon_->SetContentPreferredSize(new_size);
99 } 99 }
100 100
101 void BalloonViewHost::Init(gfx::NativeView parent_hwnd) { 101 void BalloonViewHost::Init(gfx::NativeView parent_hwnd) {
102 DCHECK(!render_view_host_) << "BalloonViewHost already initialized."; 102 DCHECK(!render_view_host_) << "BalloonViewHost already initialized.";
103 RenderViewHost* rvh = new RenderViewHost(site_instance_.get(), 103 RenderViewHost* rvh = new RenderViewHost(site_instance_.get(),
104 this, MSG_ROUTING_NONE); 104 this, MSG_ROUTING_NONE,
105 kInvalidSessionStorageNamespaceId);
105 render_view_host_ = rvh; 106 render_view_host_ = rvh;
106 107
107 // Pointer is owned by the RVH. 108 // Pointer is owned by the RVH.
108 RenderWidgetHostView* view = RenderWidgetHostView::CreateViewForWidget(rvh); 109 RenderWidgetHostView* view = RenderWidgetHostView::CreateViewForWidget(rvh);
109 rvh->set_view(view); 110 rvh->set_view(view);
110 111
111 // TODO(johnnyg): http://crbug.com/23954. Need a cross-platform solution. 112 // TODO(johnnyg): http://crbug.com/23954. Need a cross-platform solution.
112 #if defined(OS_WIN) 113 #if defined(OS_WIN)
113 RenderWidgetHostViewWin* view_win = 114 RenderWidgetHostViewWin* view_win =
114 static_cast<RenderWidgetHostViewWin*>(view); 115 static_cast<RenderWidgetHostViewWin*>(view);
(...skipping 11 matching lines...) Expand all
126 rvh->NavigateToURL(balloon_->notification().content_url()); 127 rvh->NavigateToURL(balloon_->notification().content_url());
127 initialized_ = true; 128 initialized_ = true;
128 } 129 }
129 130
130 void BalloonViewHost::ViewHierarchyChanged(bool is_add, views::View* parent, 131 void BalloonViewHost::ViewHierarchyChanged(bool is_add, views::View* parent,
131 views::View* child) { 132 views::View* child) {
132 NativeViewHost::ViewHierarchyChanged(is_add, parent, child); 133 NativeViewHost::ViewHierarchyChanged(is_add, parent, child);
133 if (is_add && GetWidget() && !initialized_) 134 if (is_add && GetWidget() && !initialized_)
134 Init(GetWidget()->GetNativeView()); 135 Init(GetWidget()->GetNativeView());
135 } 136 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/render_view_host_manager.cc ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698