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

Side by Side Diff: chrome/browser/chromeos/main_menu.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 | « no previous file | chrome/browser/extensions/extension_host.cc » ('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/chromeos/main_menu.h" 5 #include "chrome/browser/chromeos/main_menu.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "app/gfx/insets.h" 10 #include "app/gfx/insets.h"
11 #include "app/resource_bundle.h" 11 #include "app/resource_bundle.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/message_loop.h" 13 #include "base/message_loop.h"
14 #include "base/string_util.h" 14 #include "base/string_util.h"
15 #include "chrome/browser/browser_list.h" 15 #include "chrome/browser/browser_list.h"
16 #include "chrome/browser/browser.h" 16 #include "chrome/browser/browser.h"
17 #include "chrome/browser/in_process_webkit/dom_storage_context.h"
18 #include "chrome/browser/in_process_webkit/webkit_context.h"
17 #include "chrome/browser/profile.h" 19 #include "chrome/browser/profile.h"
18 #include "chrome/browser/renderer_host/render_view_host.h" 20 #include "chrome/browser/renderer_host/render_view_host.h"
19 #include "chrome/browser/renderer_host/render_view_host_factory.h" 21 #include "chrome/browser/renderer_host/render_view_host_factory.h"
20 #include "chrome/browser/renderer_host/render_widget_host_view.h" 22 #include "chrome/browser/renderer_host/render_widget_host_view.h"
21 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h" 23 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
22 #include "chrome/browser/renderer_host/site_instance.h" 24 #include "chrome/browser/renderer_host/site_instance.h"
23 #include "chrome/browser/renderer_preferences_util.h" 25 #include "chrome/browser/renderer_preferences_util.h"
24 #include "chrome/browser/tab_contents/tab_contents.h" 26 #include "chrome/browser/tab_contents/tab_contents.h"
25 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" 27 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h"
26 #include "grit/app_resources.h" 28 #include "grit/app_resources.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 gfx::Insets(kBackgroundImageTop, kBackgroundImageLeft, 143 gfx::Insets(kBackgroundImageTop, kBackgroundImageLeft,
142 kBackgroundImageBottom, kBackgroundImageRight), 144 kBackgroundImageBottom, kBackgroundImageRight),
143 false); 145 false);
144 menu_popup->GetRootView()->set_background( 146 menu_popup->GetRootView()->set_background(
145 views::Background::CreateBackgroundPainter(true, painter)); 147 views::Background::CreateBackgroundPainter(true, painter));
146 148
147 GURL menu_url(GetMenuURL()); 149 GURL menu_url(GetMenuURL());
148 DCHECK(BrowserList::begin() != BrowserList::end()); 150 DCHECK(BrowserList::begin() != BrowserList::end());
149 // TODO(sky): this shouldn't pick a random profile to use. 151 // TODO(sky): this shouldn't pick a random profile to use.
150 Profile* profile = (*BrowserList::begin())->profile(); 152 Profile* profile = (*BrowserList::begin())->profile();
153 int64 session_storage_namespace_id = profile->GetWebKitContext()->
154 dom_storage_context()->AllocateSessionStorageNamespaceId();
151 site_instance_ = SiteInstance::CreateSiteInstanceForURL(profile, menu_url); 155 site_instance_ = SiteInstance::CreateSiteInstanceForURL(profile, menu_url);
152 menu_rvh_ = new RenderViewHost(site_instance_, this, MSG_ROUTING_NONE); 156 menu_rvh_ = new RenderViewHost(site_instance_, this, MSG_ROUTING_NONE,
157 session_storage_namespace_id);
153 158
154 rwhv_ = new RenderWidgetHostViewGtk(menu_rvh_); 159 rwhv_ = new RenderWidgetHostViewGtk(menu_rvh_);
155 rwhv_->InitAsChild(); 160 rwhv_->InitAsChild();
156 menu_rvh_->CreateRenderView(profile->GetRequestContext()); 161 menu_rvh_->CreateRenderView(profile->GetRequestContext());
157 menu_popup->AddChild(rwhv_->GetNativeView()); 162 menu_popup->AddChild(rwhv_->GetNativeView());
158 gfx::Size rwhv_size = CalculateRWHVSize(popup_size); 163 gfx::Size rwhv_size = CalculateRWHVSize(popup_size);
159 menu_popup->PositionChild(rwhv_->GetNativeView(), kRendererX, kRendererY, 164 menu_popup->PositionChild(rwhv_->GetNativeView(), kRendererX, kRendererY,
160 rwhv_size.width(), rwhv_size.height()); 165 rwhv_size.width(), rwhv_size.height());
161 rwhv_->SetSize(rwhv_size); 166 rwhv_->SetSize(rwhv_size);
162 menu_rvh_->NavigateToURL(menu_url); 167 menu_rvh_->NavigateToURL(menu_url);
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 // LoadTask ------------------------------------------------------------------- 304 // LoadTask -------------------------------------------------------------------
300 305
301 void MainMenu::LoadTask::Run() { 306 void MainMenu::LoadTask::Run() {
302 if (BrowserList::begin() == BrowserList::end()) 307 if (BrowserList::begin() == BrowserList::end())
303 return; // No browser are around. Generally only happens during testing. 308 return; // No browser are around. Generally only happens during testing.
304 309
305 MainMenu::Get(); 310 MainMenu::Get();
306 } 311 }
307 312
308 } // namespace chromeos 313 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698