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

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

Issue 287123002: [WebModals] New API for browser-scoped popup management. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #endif // defined(OS_WIN) 10 #endif // defined(OS_WIN)
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 #include "chrome/common/chrome_switches.h" 144 #include "chrome/common/chrome_switches.h"
145 #include "chrome/common/custom_handlers/protocol_handler.h" 145 #include "chrome/common/custom_handlers/protocol_handler.h"
146 #include "chrome/common/net/url_fixer_upper.h" 146 #include "chrome/common/net/url_fixer_upper.h"
147 #include "chrome/common/pref_names.h" 147 #include "chrome/common/pref_names.h"
148 #include "chrome/common/profiling.h" 148 #include "chrome/common/profiling.h"
149 #include "chrome/common/search_types.h" 149 #include "chrome/common/search_types.h"
150 #include "chrome/common/url_constants.h" 150 #include "chrome/common/url_constants.h"
151 #include "components/bookmarks/core/browser/bookmark_model.h" 151 #include "components/bookmarks/core/browser/bookmark_model.h"
152 #include "components/bookmarks/core/browser/bookmark_utils.h" 152 #include "components/bookmarks/core/browser/bookmark_utils.h"
153 #include "components/startup_metric_utils/startup_metric_utils.h" 153 #include "components/startup_metric_utils/startup_metric_utils.h"
154 #include "components/web_modal/popup_manager.h"
154 #include "components/web_modal/web_contents_modal_dialog_manager.h" 155 #include "components/web_modal/web_contents_modal_dialog_manager.h"
155 #include "content/public/browser/devtools_manager.h" 156 #include "content/public/browser/devtools_manager.h"
156 #include "content/public/browser/download_item.h" 157 #include "content/public/browser/download_item.h"
157 #include "content/public/browser/download_manager.h" 158 #include "content/public/browser/download_manager.h"
158 #include "content/public/browser/interstitial_page.h" 159 #include "content/public/browser/interstitial_page.h"
159 #include "content/public/browser/invalidate_type.h" 160 #include "content/public/browser/invalidate_type.h"
160 #include "content/public/browser/navigation_controller.h" 161 #include "content/public/browser/navigation_controller.h"
161 #include "content/public/browser/navigation_entry.h" 162 #include "content/public/browser/navigation_entry.h"
162 #include "content/public/browser/notification_details.h" 163 #include "content/public/browser/notification_details.h"
163 #include "content/public/browser/notification_service.h" 164 #include "content/public/browser/notification_service.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 DISALLOW_COPY_AND_ASSIGN(InterstitialObserver); 323 DISALLOW_COPY_AND_ASSIGN(InterstitialObserver);
323 }; 324 };
324 325
325 /////////////////////////////////////////////////////////////////////////////// 326 ///////////////////////////////////////////////////////////////////////////////
326 // Browser, Constructors, Creation, Showing: 327 // Browser, Constructors, Creation, Showing:
327 328
328 Browser::Browser(const CreateParams& params) 329 Browser::Browser(const CreateParams& params)
329 : type_(params.type), 330 : type_(params.type),
330 profile_(params.profile), 331 profile_(params.profile),
331 window_(NULL), 332 window_(NULL),
333 popup_manager_(new web_modal::PopupManager()),
332 tab_strip_model_delegate_(new chrome::BrowserTabStripModelDelegate(this)), 334 tab_strip_model_delegate_(new chrome::BrowserTabStripModelDelegate(this)),
335 // Need to give a popup manager to the TSM.
333 tab_strip_model_(new TabStripModel(tab_strip_model_delegate_.get(), 336 tab_strip_model_(new TabStripModel(tab_strip_model_delegate_.get(),
334 params.profile)), 337 params.profile)),
335 app_name_(params.app_name), 338 app_name_(params.app_name),
336 is_trusted_source_(params.trusted_source), 339 is_trusted_source_(params.trusted_source),
337 cancel_download_confirmation_state_(NOT_PROMPTED), 340 cancel_download_confirmation_state_(NOT_PROMPTED),
338 override_bounds_(params.initial_bounds), 341 override_bounds_(params.initial_bounds),
339 initial_show_state_(params.initial_show_state), 342 initial_show_state_(params.initial_show_state),
340 is_session_restore_(params.is_session_restore), 343 is_session_restore_(params.is_session_restore),
341 host_desktop_type_(BrowserWindow::AdjustHostDesktopType( 344 host_desktop_type_(BrowserWindow::AdjustHostDesktopType(
342 params.host_desktop_type)), 345 params.host_desktop_type)),
(...skipping 2076 matching lines...) Expand 10 before | Expand all | Expand 10 after
2419 if (contents && !allow_js_access) { 2422 if (contents && !allow_js_access) {
2420 contents->web_contents()->GetController().LoadURL( 2423 contents->web_contents()->GetController().LoadURL(
2421 target_url, 2424 target_url,
2422 content::Referrer(), 2425 content::Referrer(),
2423 content::PAGE_TRANSITION_LINK, 2426 content::PAGE_TRANSITION_LINK,
2424 std::string()); // No extra headers. 2427 std::string()); // No extra headers.
2425 } 2428 }
2426 2429
2427 return contents != NULL; 2430 return contents != NULL;
2428 } 2431 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698