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

Side by Side Diff: chrome/browser/bookmarks/bookmark_utils.cc

Issue 10896: Re-do the way browser windows are shown:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/bookmarks/bookmark_utils.h" 5 #include "chrome/browser/bookmarks/bookmark_utils.h"
6 6
7 #include "chrome/browser/bookmarks/bookmark_drag_data.h" 7 #include "chrome/browser/bookmarks/bookmark_drag_data.h"
8 #include "chrome/browser/bookmarks/bookmark_model.h" 8 #include "chrome/browser/bookmarks/bookmark_model.h"
9 #include "chrome/browser/browser.h" 9 #include "chrome/browser/browser.h"
10 #include "chrome/browser/browser_list.h" 10 #include "chrome/browser/browser_list.h"
(...skipping 17 matching lines...) Expand all
28 // opening a url and there is no Browser open. The Browser is created the first 28 // opening a url and there is no Browser open. The Browser is created the first
29 // time the PageNavigator method is invoked. 29 // time the PageNavigator method is invoked.
30 class NewBrowserPageNavigator : public PageNavigator { 30 class NewBrowserPageNavigator : public PageNavigator {
31 public: 31 public:
32 explicit NewBrowserPageNavigator(Profile* profile) 32 explicit NewBrowserPageNavigator(Profile* profile)
33 : profile_(profile), 33 : profile_(profile),
34 browser_(NULL) {} 34 browser_(NULL) {}
35 35
36 virtual ~NewBrowserPageNavigator() { 36 virtual ~NewBrowserPageNavigator() {
37 if (browser_) 37 if (browser_)
38 browser_->Show(); 38 browser_->window()->Show();
39 } 39 }
40 40
41 Browser* browser() const { return browser_; } 41 Browser* browser() const { return browser_; }
42 42
43 virtual void OpenURL(const GURL& url, 43 virtual void OpenURL(const GURL& url,
44 const GURL& referrer, 44 const GURL& referrer,
45 WindowOpenDisposition disposition, 45 WindowOpenDisposition disposition,
46 PageTransition::Type transition) { 46 PageTransition::Type transition) {
47 if (!browser_) { 47 if (!browser_) {
48 Profile* profile = (disposition == OFF_THE_RECORD) ? 48 Profile* profile = (disposition == OFF_THE_RECORD) ?
49 profile_->GetOffTheRecordProfile() : profile_; 49 profile_->GetOffTheRecordProfile() : profile_;
50 browser_ = new Browser(gfx::Rect(), SW_SHOW, profile, 50 browser_ = Browser::Create(profile);
51 BrowserType::TABBED_BROWSER, std::wstring());
52 // Always open the first tab in the foreground. 51 // Always open the first tab in the foreground.
53 disposition = NEW_FOREGROUND_TAB; 52 disposition = NEW_FOREGROUND_TAB;
54 } 53 }
55 browser_->OpenURLFromTab(NULL, url, referrer, NEW_FOREGROUND_TAB, transition ); 54 browser_->OpenURLFromTab(NULL, url, referrer, NEW_FOREGROUND_TAB, transition );
56 } 55 }
57 56
58 private: 57 private:
59 Profile* profile_; 58 Profile* profile_;
60 Browser* browser_; 59 Browser* browser_;
61 60
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 IDataObject* data; 283 IDataObject* data;
285 if (OleGetClipboard(&data) != S_OK) 284 if (OleGetClipboard(&data) != S_OK)
286 return false; 285 return false;
287 286
288 OSExchangeData data_wrapper(data); 287 OSExchangeData data_wrapper(data);
289 BookmarkDragData bookmark_data; 288 BookmarkDragData bookmark_data;
290 return bookmark_data.Read(data_wrapper); 289 return bookmark_data.Read(data_wrapper);
291 } 290 }
292 291
293 } // namespace bookmark_utils 292 } // namespace bookmark_utils
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698