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

Side by Side Diff: chrome/browser/views/app_launcher.cc

Issue 1989002: The app launcher had a height of zero as it was not getting preferred size up... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 7 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) 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/views/app_launcher.h" 5 #include "chrome/browser/views/app_launcher.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/message_loop.h" 12 #include "base/message_loop.h"
13 #include "base/string_util.h" 13 #include "base/string_util.h"
14 #include "base/task.h" 14 #include "base/task.h"
15 #include "chrome/app/chrome_dll_resource.h" 15 #include "chrome/app/chrome_dll_resource.h"
16 #include "chrome/browser/browser.h" 16 #include "chrome/browser/browser.h"
17 #include "chrome/browser/browser_window.h" 17 #include "chrome/browser/browser_window.h"
18 #include "chrome/browser/profile.h" 18 #include "chrome/browser/profile.h"
19 #include "chrome/browser/renderer_host/render_view_host.h"
20 #include "chrome/browser/tab_contents/tab_contents.h" 19 #include "chrome/browser/tab_contents/tab_contents.h"
21 #include "chrome/browser/view_ids.h" 20 #include "chrome/browser/view_ids.h"
22 #include "chrome/browser/views/dom_view.h" 21 #include "chrome/browser/views/dom_view.h"
23 #include "chrome/browser/views/info_bubble.h" 22 #include "chrome/browser/views/info_bubble.h"
24 #include "chrome/browser/views/frame/browser_view.h" 23 #include "chrome/browser/views/frame/browser_view.h"
25 #include "chrome/browser/views/location_bar/location_bar_view.h" 24 #include "chrome/browser/views/location_bar/location_bar_view.h"
26 #include "chrome/common/url_constants.h" 25 #include "chrome/common/url_constants.h"
27 #include "views/widget/root_view.h" 26 #include "views/widget/root_view.h"
28 27
29 #if defined(OS_CHROMEOS) 28 #if defined(OS_CHROMEOS)
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 return; 158 return;
160 159
161 DCHECK(!dom_view_); 160 DCHECK(!dom_view_);
162 dom_view_ = new DOMView(); 161 dom_view_ = new DOMView();
163 AddChildView(dom_view_); 162 AddChildView(dom_view_);
164 // We pass NULL for site instance so the renderer uses its own process. 163 // We pass NULL for site instance so the renderer uses its own process.
165 dom_view_->Init(app_launcher_->browser()->profile(), NULL); 164 dom_view_->Init(app_launcher_->browser()->profile(), NULL);
166 // We make the AppLauncher the TabContents delegate so we get notifications 165 // We make the AppLauncher the TabContents delegate so we get notifications
167 // from the page to open links. 166 // from the page to open links.
168 dom_view_->tab_contents()->set_delegate(app_launcher_); 167 dom_view_->tab_contents()->set_delegate(app_launcher_);
169 dom_view_->tab_contents()->render_view_host()->
170 EnablePreferredSizeChangedMode();
171 GURL url = GetMenuURL(); 168 GURL url = GetMenuURL();
172 std::string ref = url.ref(); 169 std::string ref = url.ref();
173 if (!app_launcher_->hash_params().empty()) { 170 if (!app_launcher_->hash_params().empty()) {
174 if (!ref.empty()) 171 if (!ref.empty())
175 ref += "&"; 172 ref += "&";
176 ref += app_launcher_->hash_params(); 173 ref += app_launcher_->hash_params();
177 174
178 url_canon::Replacements<char> replacements; 175 url_canon::Replacements<char> replacements;
179 replacements.SetRef(ref.c_str(), url_parse::Component(0, ref.size())); 176 replacements.SetRef(ref.c_str(), url_parse::Component(0, ref.size()));
180 url = url.ReplaceComponents(replacements); 177 url = url.ReplaceComponents(replacements);
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 NULL, std::string()); 347 NULL, std::string());
351 break; 348 break;
352 } 349 }
353 } 350 }
354 #else 351 #else
355 browser_->AddTabWithURL(url, GURL(), transition, -1, 352 browser_->AddTabWithURL(url, GURL(), transition, -1,
356 Browser::ADD_SELECTED | Browser::ADD_FORCE_INDEX, 353 Browser::ADD_SELECTED | Browser::ADD_FORCE_INDEX,
357 NULL, std::string()); 354 NULL, std::string());
358 #endif 355 #endif
359 } 356 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698