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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views_win.cc

Issue 10692195: Consolidate Browser Creation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/views/bookmarks/bookmark_context_menu_controller_vie ws_win.h" 5 #include "chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_vie ws_win.h"
6 6
7 #include "base/win/metro.h" 7 #include "base/win/metro.h"
8 #include "chrome/app/chrome_command_ids.h" 8 #include "chrome/app/chrome_command_ids.h"
9 #include "chrome/browser/bookmarks/bookmark_utils.h" 9 #include "chrome/browser/bookmarks/bookmark_utils.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 26 matching lines...) Expand all
37 if (browser_) 37 if (browser_)
38 browser_->window()->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 WebContents* OpenURL(const OpenURLParams& params) OVERRIDE { 43 virtual WebContents* OpenURL(const OpenURLParams& params) OVERRIDE {
44 if (!browser_) { 44 if (!browser_) {
45 Profile* profile = (params.disposition == OFF_THE_RECORD) ? 45 Profile* profile = (params.disposition == OFF_THE_RECORD) ?
46 profile_->GetOffTheRecordProfile() : profile_; 46 profile_->GetOffTheRecordProfile() : profile_;
47 browser_ = Browser::Create(profile); 47 browser_ = new Browser(Browser::CreateParams(profile));
48 } 48 }
49 49
50 OpenURLParams forward_params = params; 50 OpenURLParams forward_params = params;
51 forward_params.disposition = NEW_FOREGROUND_TAB; 51 forward_params.disposition = NEW_FOREGROUND_TAB;
52 return browser_->OpenURL(forward_params); 52 return browser_->OpenURL(forward_params);
53 } 53 }
54 54
55 private: 55 private:
56 Profile* profile_; 56 Profile* profile_;
57 Browser* browser_; 57 Browser* browser_;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 if (id == IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW && 147 if (id == IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW &&
148 !profile()->IsOffTheRecord()) { 148 !profile()->IsOffTheRecord()) {
149 return false; 149 return false;
150 } else if (id == IDC_BOOKMARK_BAR_OPEN_ALL_INCOGNITO && 150 } else if (id == IDC_BOOKMARK_BAR_OPEN_ALL_INCOGNITO &&
151 profile()->IsOffTheRecord()) { 151 profile()->IsOffTheRecord()) {
152 return false; 152 return false;
153 } 153 }
154 } 154 }
155 return BookmarkContextMenuControllerViews::IsCommandEnabled(id); 155 return BookmarkContextMenuControllerViews::IsCommandEnabled(id);
156 } 156 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698